@sweebee Oh, that easy. Didn’t know that. In the arduino world it is easy to mess up libraries easily I noticed. But this of course is something different
-
How to Mysensors.
-
@sweebee Just did the update.
When looking at the Messages and selecting debug I can only select All or Pimatic as plugin. Although all plugins are working.
In the PIR details/graph I now see the battery as item to select for the graph. However the battery icon is missing on the front screen. -
@Petjepet try to refresh your cache, I think that should fix the battery. I have added an option to disable debug for mysensors, but by default its enabled. It only appears when the plugin has logged something. If a plugin hasn’t log anything it also won’t be shown.
-
@sweebee Now all plugins are listed again in the message window.
However after clearing the cache still no battery icon. Do I need to update something on the sensor? -
@Petjepet What if you reboot/reset the sensor? Just updated pimatic at my parents and it works fine with the icons.
-
@Petjepet my fathers phone also didn’t show it in the webapp on iPhone. I had to remove it and add it again to successfully clear the cache.
-
@sweebee Now my iPhone is showing the battery, but the solid one. Is the new battery with the lines part of future version 0.9?
-
@Petjepet the battery is 100%? Then it’s solid. If it’s < 100 it should show stripes.
-
@sweebee Check!
-
@Petjepet nice, good to hear it’s working. Also finally managed to get my esp working. Will try to add the Ethernet gateway.
-
Btw, people that are using the pro mini on batteries, have you disabled the bod or flashed the 1mhz firmware?
Otherwise the pro mini stops working under 2.8v
-
How to re-use your wall switch
Uses around 15-20 uA. Good for atleast 5 year with 2 AAA batteries.
-
Hello,
Thanks sweebee for all information and help.
I have try it again and now it works in serial monitoring in arduino.
serialgateway:
0;0;3;0;9;gateway started, id=0, parent=0, distance=0
0;0;3;0;14;Gateway startup complete.
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
dth22 :send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
H: 45.10
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
T: 22.30.
When i put the serialgateway to my raspberry i have no debug in the messages and it says that mysensorsgateway is started. What went wrong.
Thanks gerrit. -
@sweebee said:
#define NODE_ID AUTO to #define NODE_ID 1.
Where can i change this. I cannot find the map where it is.
Thanks. -
@ghv can you post Your sketch?
Have you also enabled debug in pimatic config?“Debug”:true,
“LogLevel”:“debug” -
This is my sketch in the config of pimatic.
I used it from the forum.
{
“plugin”: “mysensors”,
“driver”: “serialport”,
“protocols”: “1.5.4”,
“startingNodeId”: 2,
“driverOptions”: {
“serialDevice”: “/dev/ttyUSB0”,
“baudrate”: 115200
}
} -
@ghv i mean the arduino sketch of your sensor. There you can set a nodeid manually.
-
It is the sketch in the map of mysensors.
#include <SPI.h>
#include <MySensor.h>
#include <DHT.h>#define CHILD_ID_HUM 0
#define CHILD_ID_TEMP 1
#define HUMIDITY_SENSOR_DIGITAL_PIN 3
unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)MySensor gw;
DHT dht;
float lastTemp;
float lastHum;
boolean metric = true;
MyMessage msgHum(CHILD_ID_HUM, V_HUM);
MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);void setup()
{
gw.begin();
dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);// Send the Sketch Version Information to the Gateway
gw.sendSketchInfo(“Humidity”, “1.0”);// Register all sensors to gw (they will be created as child devices)
gw.present(CHILD_ID_HUM, S_HUM);
gw.present(CHILD_ID_TEMP, S_TEMP);metric = gw.getConfig().isMetric;
}void loop()
{
delay(dht.getMinimumSamplingPeriod());float temperature = dht.getTemperature();
if (isnan(temperature)) {
Serial.println(“Failed reading temperature from DHT”);
} else if (temperature != lastTemp) {
lastTemp = temperature;
if (!metric) {
temperature = dht.toFahrenheit(temperature);
}
gw.send(msgTemp.set(temperature, 1));
Serial.print("T: ");
Serial.println(temperature);
}float humidity = dht.getHumidity();
if (isnan(humidity)) {
Serial.println(“Failed reading humidity from DHT”);
} else if (humidity != lastHum) {
lastHum = humidity;
gw.send(msgHum.set(humidity, 1));
Serial.print("H: ");
Serial.println(humidity);
}gw.sleep(SLEEP_TIME); //sleep a bit
} -
@ghv change
gw.begin();
to
gw.begin(NULL, 1);
and add this device to pimatic:
{ "id": "DHT", "name": "DHT", "class": "MySensorsDHT", "nodeid": 1, "batterySensor": true, "sensorid": [ 0, 1 ] }
-
I’m still in trouble with setting up my first mySensors.
Can you please give me a small assistance?After pimatic start i get this info what seems ok for me :
info [pimatic-mysensors]: Connected to MySensors Gateway.
One sensor is communicating with the gateway as I see the Tx Led from gateway blinking when switching the button of the sensor node.
But nothing else is shown in the message logs and not any reaction on the device in the screen.Did I miss something?
I used MySensors SerialGateway from 1.5.4 version with this serial debug after startup of the Nano:
NodeId =1send: 1-1-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=fail:0 send: 1-1-0-0 s=255,c=0,t=18,pt=0,l=5,sg=0,st=fail:1.5.4 send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=fail:0 repeater started, id=1, parent=0, distance=1 0;0;3;0;14;Gateway startup complete.
My first node is setup with example “BinarySwitchSensor.ino” and manually set nodeId =2 and childId = 1
Arduino serial debug gives when switching the manual button.send: 2-2-1-0 s=1,c=1,t=16,pt=2,l=2,sg=0,st=ok:0 send: 2-2-1-0 s=1,c=1,t=16,pt=2,l=2,sg=0,st=ok:1
Gateway response at same time is following: (but nothing happens if connected back to pimatic and restart)
read and forward: 2-2-0 s=1,c=1,t=16,pt=2,l=2,sg=0:0 send: 2-1-0-0 s=1,c=1,t=16,pt=2,l=2,sg=0,st=fail:0 read and forward: 2-2-0 s=1,c=1,t=16,pt=2,l=2,sg=0:1 send: 2-1-0-0 s=1,c=1,t=16,pt=2,l=2,sg=0,st=fail:1
pimatic plugins:
"plugin": "mysensors", "driver": "serialport", "protocols": "1.5.4", "startingNodeId": 1, "driverOptions": { "serialDevice": "/dev/ttyUSB0", "baudrate": 115200 } } "devices": [ { "id": "Door", "name": "Door", "class": "MySensorsButton", "nodeid": 2, "batterySensor": true, "sensorid": 1 },