@patrikr76 thank you so much. I had the same issue with my motion sensor and spent 2 days pulling my hair out)
Posts made by bereska
-
RE: 💬 Motion Sensor
-
RE: 💬 Water Meter Pulse Sensor
@rejoe2 i did like you said, still no show in HA
here is the serial log:__ __ ____ | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.3.0 16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0 26 TSM:INIT 28 TSF:WUR:MS=0 34 !TSM:INIT:TSP FAIL 36 TSM:FAIL:CNT=1 38 TSM:FAIL:DIS 40 TSF:TDI:TSL __ __ ____ | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.3.0 16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0 26 TSM:INIT 28 TSF:WUR:MS=0 34 TSM:INIT:TSP OK 36 TSM:INIT:STATID=6 38 TSF:SID:OK,ID=6 40 TSM:FPAR 77 TSF:MSG:SEND,6-6-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 532 TSF:MSG:READ,0-0-6,s=255,c=3,t=8,pt=1,l=1,sg=0:0 538 TSF:MSG:FPAR OK,ID=0,D=1 624 TSF:MSG:READ,31-31-6,s=255,c=3,t=8,pt=1,l=1,sg=0:1 1267 TSF:MSG:READ,21-21-6,s=255,c=3,t=8,pt=1,l=1,sg=0:1 1546 TSF:MSG:READ,41-41-6,s=255,c=3,t=8,pt=1,l=1,sg=0:1 2088 TSM:FPAR:OK 2088 TSM:ID 2091 TSM:ID:OK 2093 TSM:UPL 2097 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 2103 TSF:MSG:READ,0-0-6,s=255,c=3,t=25,pt=1,l=1,sg=0:1 2109 TSF:MSG:PONG RECV,HP=1 2113 TSM:UPL:OK 2115 TSM:READY:ID=6,PAR=0,DIS=1 2119 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 2127 TSF:MSG:READ,0-0-6,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 2138 TSF:MSG:SEND,6-6-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.0 2148 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 2242 TSF:MSG:READ,0-0-6,s=255,c=3,t=6,pt=0,l=1,sg=0:M 2250 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=11,pt=0,l=11,sg=0,ft=0,st=OK:Water Meter 2260 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.1 2273 TSF:MSG:SEND,6-6-0-0,s=1,c=0,t=21,pt=0,l=0,sg=0,ft=0,st=OK: 2281 MCO:REG:REQ 2289 TSF:MSG:SEND,6-6-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 2297 TSF:MSG:READ,0-0-6,s=255,c=3,t=27,pt=1,l=1,sg=0:1 2304 MCO:PIM:NODE REG=1 2306 MCO:BGN:STP 2310 TSF:MSG:SEND,6-6-0-0,s=1,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=OK: 2318 MCO:BGN:INIT OK,TSP=1 32319 TSF:MSG:SEND,6-6-0-0,s=1,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=OK:
-
RE: 💬 Water Meter Pulse Sensor
@rejoe2 thank you. How do i trigger "the counter on Node side"?
-
RE: mysprinkler for mysensor and home assistant not working together
@johannes-schoeller did you find a solution? I am struggling to add a water meter pulse sensor to HA UI. Thank you
-
RE: 💬 Water Meter Pulse Sensor
Is it possible to get any help on this page or not?
-
RE: Relay shows up in mysensors.json but not in gui [homeassistant]
i can't get this sensor to show up in HA. Any ideas anyone?
-
RE: Relay shows up in mysensors.json but not in gui [homeassistant]
@jens-jensen it does send and register the name, no problem.
-
RE: Relay shows up in mysensors.json but not in gui [homeassistant]
@jens-jensen said in Relay shows up in mysensors.json but not in gui [homeassistant]:
V_FLOW and V_VOLUME values are sent after some time
no, V_FLOW and V_VOLUME values are NOT sent after some time
how to i modify the sketch to make it happen? -
WaterMeterPulseSensor not showing up in HA UI
HA docker on rpi 0.95.4
I have a dozen of mysensors sensors already running just fine via nrf24 gw + mqtt
But I have trouble adding this one water meter pulse sensor.
https://www.mysensors.org/build/pulse_water
It shows up in mysensors.json and ha logs but fails to appear in states and GUI.
I think the problem is the default sketch does not send an initial value to gw, but I lack knowledge modifying it properly.
Thank you for your help -
RE: 💬 Water Meter Pulse Sensor
looks like the problem is the node is NOT sending initial value to gw
need your help modifying the sketch accordingly
thank you -
RE: 💬 Water Meter Pulse Sensor
here is the sketch:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RF24 #define MY_NODE_ID 6 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #include <MySensors.h> #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your sensor. (Only 2 and 3 generates interrupt!) #define PULSE_FACTOR 1000 // Number of blinks per m3 of your meter (One rotation/liter) #define SLEEP_MODE false // flowvalue can only be reported when sleep mode is false. #define MAX_FLOW 40 // Max flow (l/min) value to report. This filters outliers. #define CHILD_ID 1 // Id of the sensor child uint32_t SEND_FREQUENCY = 30000; // Minimum time between send (in milliseconds). We don't want to spam the gateway. MyMessage flowMsg(CHILD_ID,V_FLOW); MyMessage volumeMsg(CHILD_ID,V_VOLUME); MyMessage lastCounterMsg(CHILD_ID,V_VAR1); double ppl = ((double)PULSE_FACTOR)/1000; // Pulses per liter volatile uint32_t pulseCount = 0; volatile uint32_t lastBlink = 0; volatile double flow = 0; bool pcReceived = false; uint32_t oldPulseCount = 0; uint32_t newBlink = 0; double oldflow = 0; double volume =0; double oldvolume =0; uint32_t lastSend =0; uint32_t lastPulse =0; void setup() { // initialize our digital pins internal pullup resistor so one pulse switches from high to low (less distortion) pinMode(DIGITAL_INPUT_SENSOR, INPUT_PULLUP); pulseCount = oldPulseCount = 0; // Fetch last known pulse count value from gw request(CHILD_ID, V_VAR1); lastSend = lastPulse = millis(); attachInterrupt(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), onPulse, FALLING); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Water Meter", "1.1"); // Register this device as Water flow sensor present(CHILD_ID, S_WATER); } void loop() { uint32_t currentTime = millis(); // Only send values at a maximum frequency or woken up from sleep if (SLEEP_MODE || (currentTime - lastSend > SEND_FREQUENCY)) { lastSend=currentTime; if (!pcReceived) { //Last Pulsecount not yet received from controller, request it again request(CHILD_ID, V_VAR1); return; } if (!SLEEP_MODE && flow != oldflow) { oldflow = flow; Serial.print("l/min:"); Serial.println(flow); // Check that we don't get unreasonable large flow value. // could happen when long wraps or false interrupt triggered if (flow<((uint32_t)MAX_FLOW)) { send(flowMsg.set(flow, 2)); // Send flow value to gw } } // No Pulse count received in 2min if(currentTime - lastPulse > 120000) { flow = 0; } // Pulse count has changed if ((pulseCount != oldPulseCount)||(!SLEEP_MODE)) { oldPulseCount = pulseCount; Serial.print("pulsecount:"); Serial.println(pulseCount); send(lastCounterMsg.set(pulseCount)); // Send pulsecount value to gw in VAR1 double volume = ((double)pulseCount/((double)PULSE_FACTOR)); if ((volume != oldvolume)||(!SLEEP_MODE)) { oldvolume = volume; Serial.print("volume:"); Serial.println(volume, 3); send(volumeMsg.set(volume, 3)); // Send volume value to gw } } } if (SLEEP_MODE) { sleep(SEND_FREQUENCY); } } void receive(const MyMessage &message) { if (message.type==V_VAR1) { uint32_t gwPulseCount=message.getULong(); pulseCount += gwPulseCount; flow=oldflow=0; Serial.print("Received last pulse count from gw:"); Serial.println(pulseCount); pcReceived = true; } } void onPulse() { if (!SLEEP_MODE) { uint32_t newBlink = micros(); uint32_t interval = newBlink-lastBlink; if (interval!=0) { lastPulse = millis(); if (interval<500000L) { // Sometimes we get interrupt on RISING, 500000 = 0.5 second debounce ( max 120 l/min) return; } flow = (60000000.0 /interval) / ppl; } lastBlink = newBlink; } pulseCount++; }```
-
RE: 💬 Water Meter Pulse Sensor
this is HA log:
2019-07-04 23:24:05 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on mygateway1-out/6/255/3/0/11: b'Water Meter',
2019-07-04 23:24:05 DEBUG (MainThread) [mysensors.gateway_mqtt] Receiving 6;255;3;0;11;Water Meter,
2019-07-04 23:24:23 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on mygateway1-out/6/255/3/0/11: b'Water Meter',
2019-07-04 23:24:23 DEBUG (MainThread) [mysensors.gateway_mqtt] Receiving 6;255;3;0;11;Water Meter -
RE: Relay shows up in mysensors.json but not in gui [homeassistant]
this is HA log:
2019-07-04 23:24:05 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on mygateway1-out/6/255/3/0/11: b'Water Meter',
2019-07-04 23:24:05 DEBUG (MainThread) [mysensors.gateway_mqtt] Receiving 6;255;3;0;11;Water Meter,
2019-07-04 23:24:23 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on mygateway1-out/6/255/3/0/11: b'Water Meter',
2019-07-04 23:24:23 DEBUG (MainThread) [mysensors.gateway_mqtt] Receiving 6;255;3;0;11;Water Meter -
RE: Relay shows up in mysensors.json but not in gui [homeassistant]
@jens-jensen thank you, like you said the sketch looks ok. Yet this only sensor fails to appear in HA, neither on dashboard nor in states or unused entities. The only thing I have noticed though is that this sketch is missing this part:
Bounce debouncer = Bounce(); bool state = false; bool initialValueSent = false;
maybe that's the key to this problem?
-
RE: Relay shows up in mysensors.json but not in gui [homeassistant]
@jens-jensen thank you for your input
could you have a look at my sketch above and point me in the right direction on what needs to be changed/added?
I see this part which looks good to me:MyMessage flowMsg(CHILD_ID,V_FLOW); MyMessage volumeMsg(CHILD_ID,V_VOLUME); MyMessage lastCounterMsg(CHILD_ID,V_VAR1);``` thanks
-
RE: Relay shows up in mysensors.json but not in gui [homeassistant]
@mcchots thank you, that's what I thought, too. Let me rig it up on my water meter and see if starts sending any data
-
RE: 💬 Water Meter Pulse Sensor
Water Meter shows up in mysensors.json and homeassistant logs but fails to appear in Homeassistant GUI.
I have a dozen Nodes already successfully operating
I used the default sketch on this page. Just added Node 6
Looks like values are not getting through
Thank you for your help -
RE: Relay shows up in mysensors.json but not in gui [homeassistant]
i have the same very problem adding a water mater pulse sensor with the following sketch from mysensors.org
/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2018 Sensnology AB * Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik Ekblad * Version 1.1 - GizMoCuz * * DESCRIPTION * Use this sensor to measure volume and flow of your house water meter. * You need to set the correct pulsefactor of your meter (pulses per m3). * The sensor starts by fetching current volume reading from gateway (VAR 1). * Reports both volume and flow back to gateway. * * Unfortunately millis() won't increment when the Arduino is in * sleepmode. So we cannot make this sensor sleep if we also want * to calculate/report flow. * http://www.mysensors.org/build/pulse_water */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RF24 #define MY_NODE_ID 6 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #include <MySensors.h> #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your sensor. (Only 2 and 3 generates interrupt!) #define PULSE_FACTOR 1000 // Number of blinks per m3 of your meter (One rotation/liter) #define SLEEP_MODE false // flowvalue can only be reported when sleep mode is false. #define MAX_FLOW 40 // Max flow (l/min) value to report. This filters outliers. #define CHILD_ID 1 // Id of the sensor child uint32_t SEND_FREQUENCY = 30000; // Minimum time between send (in milliseconds). We don't want to spam the gateway. MyMessage flowMsg(CHILD_ID,V_FLOW); MyMessage volumeMsg(CHILD_ID,V_VOLUME); MyMessage lastCounterMsg(CHILD_ID,V_VAR1); double ppl = ((double)PULSE_FACTOR)/1000; // Pulses per liter volatile uint32_t pulseCount = 0; volatile uint32_t lastBlink = 0; volatile double flow = 0; bool pcReceived = false; uint32_t oldPulseCount = 0; uint32_t newBlink = 0; double oldflow = 0; double volume =0; double oldvolume =0; uint32_t lastSend =0; uint32_t lastPulse =0; void setup() { // initialize our digital pins internal pullup resistor so one pulse switches from high to low (less distortion) pinMode(DIGITAL_INPUT_SENSOR, INPUT_PULLUP); pulseCount = oldPulseCount = 0; // Fetch last known pulse count value from gw request(CHILD_ID, V_VAR1); lastSend = lastPulse = millis(); attachInterrupt(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), onPulse, FALLING); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Water Meter", "1.1"); // Register this device as Water flow sensor present(CHILD_ID, S_WATER); } void loop() { uint32_t currentTime = millis(); // Only send values at a maximum frequency or woken up from sleep if (SLEEP_MODE || (currentTime - lastSend > SEND_FREQUENCY)) { lastSend=currentTime; if (!pcReceived) { //Last Pulsecount not yet received from controller, request it again request(CHILD_ID, V_VAR1); return; } if (!SLEEP_MODE && flow != oldflow) { oldflow = flow; Serial.print("l/min:"); Serial.println(flow); // Check that we don't get unreasonable large flow value. // could happen when long wraps or false interrupt triggered if (flow<((uint32_t)MAX_FLOW)) { send(flowMsg.set(flow, 2)); // Send flow value to gw } } // No Pulse count received in 2min if(currentTime - lastPulse > 120000) { flow = 0; } // Pulse count has changed if ((pulseCount != oldPulseCount)||(!SLEEP_MODE)) { oldPulseCount = pulseCount; Serial.print("pulsecount:"); Serial.println(pulseCount); send(lastCounterMsg.set(pulseCount)); // Send pulsecount value to gw in VAR1 double volume = ((double)pulseCount/((double)PULSE_FACTOR)); if ((volume != oldvolume)||(!SLEEP_MODE)) { oldvolume = volume; Serial.print("volume:"); Serial.println(volume, 3); send(volumeMsg.set(volume, 3)); // Send volume value to gw } } } if (SLEEP_MODE) { sleep(SEND_FREQUENCY); } } void receive(const MyMessage &message) { if (message.type==V_VAR1) { uint32_t gwPulseCount=message.getULong(); pulseCount += gwPulseCount; flow=oldflow=0; Serial.print("Received last pulse count from gw:"); Serial.println(pulseCount); pcReceived = true; } } void onPulse() { if (!SLEEP_MODE) { uint32_t newBlink = micros(); uint32_t interval = newBlink-lastBlink; if (interval!=0) { lastPulse = millis(); if (interval<500000L) { // Sometimes we get interrupt on RISING, 500000 = 0.5 second debounce ( max 120 l/min) return; } flow = (60000000.0 /interval) / ppl; } lastBlink = newBlink; } pulseCount++; }
Node 6 as Water Meter shows up in mysensors.json and homeassistant logs but fails to appear in GUI.
Thank you for your help -
RE: Multiple Relays + Motion sketch, fully customizable, optional timer, manual override
@HenryWhite thank you for the excellent sketch. It works like a charm in my HA configuration!
-
RE: can't get DHT22 sensor to work with home assistant via mqtt gateway
hi again
I got it workingInsex00|⸮⸮E⸮V⸮U⸮ 23:24:18.693 -> __ __ ____ 23:24:18.693 -> | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ 23:24:18.693 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| 23:24:18.693 -> | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ 23:24:18.728 -> |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ 23:24:18.728 -> |___/ 2.3.0 23:24:18.728 -> 23:24:18.728 -> 16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0 23:24:18.728 -> 25 TSM:INIT 23:24:18.728 -> 26 TSF:WUR:MS=0 23:24:18.728 -> 33 TSM:INIT:TSP OK 23:24:18.728 -> 35 TSM:INIT:STATID=22 23:24:18.728 -> 37 TSF:SID:OK,ID=22 23:24:18.728 -> 39 TSM:FPAR 75 TSF:MSG:SEND,22-22-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 880 TSF:MSG:READ,0-0-22,s=255,c=3,t=8,pt=1,l=1,sg=0:0 23:24:19.581 -> 885 TSF:MSG:FPAR OK,ID=0,D=1 2082 TSM:FPAR:OK 23:24:20.765 -> 2083 TSM:ID 23:24:20.765 -> 2084 TSM:ID:OK 23:24:20.800 -> 2086 TSM:UPL 23:24:20.800 -> 2089 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 23:24:20.800 -> 2096 TSF:MSG:READ,0-0-22,s=255,c=3,t=25,pt=1,l=1,sg=0:1 23:24:20.800 -> 2101 TSF:MSG:PONG RECV,HP=1 23:24:20.800 -> 2104 TSM:UPL:OK 23:24:20.800 -> 2105 TSM:READY:ID=22,PAR=0,DIS=1 23:24:20.800 -> 2110 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 23:24:20.800 -> 2116 TSF:MSG:READ,0-0-22,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 23:24:20.833 -> 2126 TSF:MSG:SEND,22-22-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.0 23:24:20.833 -> 2135 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 4142 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=11,pt=0,l=5,sg=0,ft=0,st=OK:DHT22 23:24:22.854 -> 4151 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0 23:24:22.854 -> 4159 TSF:MSG:SEND,22-22-0-0,s=1,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 23:24:22.854 -> 4166 TSF:MSG:SEND,22-22-0-0,s=0,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK: 23:24:22.854 -> 4172 MCO:REG:REQ 23:24:22.854 -> 4176 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 23:24:22.890 -> 4183 TSF:MSG:READ,0-0-22,s=255,c=3,t=27,pt=1,l=1,sg=0:1 23:24:22.890 -> 4188 MCO:PIM:NODE REG=1 23:24:22.890 -> 4190 MCO:BGN:STP 6192 MCO:SLP:MS=2000,SMS=0,I1=255,M1=255,I2=255,M2=255 23:24:24.891 -> 6197 TSF:TDI:TSL 6199 MCO:SLP:WUP=-1 23:24:27.107 -> 6200 TSF:TRI:TSB 6207 MCO:BGN:INIT OK,TSP=1 23:24:27.142 -> Failed reading temperature from DHT! 23:24:27.142 -> Failed reading humidity from DHT 16218 TSF:MSG:SEND,22-22-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:24.9 23:24:37.137 -> T: 24.90 23:24:37.137 -> 16227 TSF:MSG:SEND,22-22-0-0,s=1,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:51.7 23:24:37.137 -> H: 51.70 26242 TSF:MSG:SEND,22-22-0-0,s=0,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:24.8 23:24:47.138 -> T: 24.80 23:24:47.138 -> 26251 TSF:MSG:SEND,22-22-0-0,s=1,c=1,t=1,pt=7,l=5,sg=0,ft=0,st=OK:51.9 23:24:47.138 -> H: 51.90 rt Code Here
but the sensor fails to show up in home assistant dashboard(
afrter restarting homeassistant I found this in homeassistant log:018-11-06 05:40:14 INFO (MainThread) [mysensors] Stopping gateway Config directory: /config starting version 3.2.5 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.loader] Loaded websocket_api from homeassistant.components.websocket_api 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.loader] Loaded history from homeassistant.components.history 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.loader] Loaded recorder from homeassistant.components.recorder 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.loader] Loaded http from homeassistant.components.http 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.loader] Loaded mqtt from homeassistant.components.mqtt 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.setup] Setting up mqtt 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.setup] Setup of domain mqtt took 0.0 seconds. 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.loader] Loaded logger from homeassistant.components.logger 2018-11-06 05:40:34 INFO (MainThread) [homeassistant.setup] Setting up logger 2018-11-06 05:40:34 ERROR (MainThread) [homeassistant.components.mqtt] Failed to connect due to exception: [Errno 111] Connection refused 2018-11-06 05:40:40 WARNING (MainThread) [homeassistant.components.mysensors] debug option for mysensors is deprecated. Please remove debug from your configuration file 2018-11-06 05:40:40 DEBUG (SyncWorker_0) [mysensors.persistence] Loading sensors from persistence file /config/mysensors1.pickle 2018-11-06 05:40:41 DEBUG (SyncWorker_1) [mysensors.persistence] Saving sensors to persistence file /config/mysensors1.pickle 2018-11-06 05:40:42 INFO (MainThread) [mysensors.gateway_mqtt] Setting up initial MQTT topic subscription 2018-11-06 05:40:42 DEBUG (MainThread) [mysensors.gateway_mqtt] Subscribing to: mygateway1-out/+/+/0/+/+, qos: 0 2018-11-06 05:40:42 DEBUG (MainThread) [mysensors.gateway_mqtt] Subscribing to: mygateway1-out/+/+/3/+/+, qos: 0 2018-11-06 05:40:42 DEBUG (MainThread) [mysensors.gateway_mqtt] Subscribing to: mygateway1-out/0/+/4/+/+, qos: 0 2018-11-06 05:40:42 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to mygateway1-out/+/+/0/+/+ 2018-11-06 05:40:42 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to mygateway1-out/+/+/3/+/+ 2018-11-06 05:40:42 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to mygateway1-out/0/+/4/+/+ 2018-11-06 05:40:43 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 279, in async_subscribe topic, msg_callback, qos, encoding) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 659, in async_subscribe await self._async_perform_subscription(topic, qos) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 694, in _async_perform_subscription _raise_on_error(result) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 779, in _raise_on_error 'Error talking to MQTT: {}'.format(mqtt.error_string(result_code))) homeassistant.exceptions.HomeAssistantError: Error talking to MQTT: The client is not currently connected. 2018-11-06 05:40:43 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 279, in async_subscribe topic, msg_callback, qos, encoding) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 659, in async_subscribe await self._async_perform_subscription(topic, qos) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 694, in _async_perform_subscription _raise_on_error(result) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 779, in _raise_on_error 'Error talking to MQTT: {}'.format(mqtt.error_string(result_code))) homeassistant.exceptions.HomeAssistantError: Error talking to MQTT: The client is not currently connected. 2018-11-06 05:40:43 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 279, in async_subscribe topic, msg_callback, qos, encoding) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 659, in async_subscribe await self._async_perform_subscription(topic, qos) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 694, in _async_perform_subscription _raise_on_error(result) File "/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/__init__.py", line 779, in _raise_on_error 'Error talking to MQTT: {}'.format(mqtt.error_string(result_code))) homeassistant.exceptions.HomeAssistantError: Error talking to MQTT: The client is not currently connected. 2018-11-06 05:40:50 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting 2018-11-06 05:40:54 WARNING (SyncWorker_9) [netdisco.ssdp] Error fetching description at http://192.168.1.68:49152/wps_device.xml
any help is much appreciated
thank you -
RE: can't get DHT22 sensor to work with home assistant via mqtt gateway
Hi @mfalkvidd
thank you for your prompt reply
I promise i will follow the rules
i'm very new to this, please bear with me)
I've spent all this time studying logs and trying different nrf24 radios (standard & LNA), but no dice(
please help
here is the last log from the Arduino serial read:14:57:02.641 -> __ __ ____ 14:57:02.641 -> | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ 14:57:02.641 -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| 14:57:02.641 -> | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ 14:57:02.674 -> |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ 14:57:02.674 -> |___/ 2.3.0 14:57:02.674 -> 14:57:02.674 -> 16 MCO:BGN:INIT NODE,CP=RNNNA---,VER=2.3.0 14:57:02.674 -> 25 TSM:INIT 14:57:02.674 -> 26 TSF:WUR:MS=0 14:57:02.674 -> 33 TSM:INIT:TSP OK 14:57:02.674 -> 35 TSM:INIT:STATID=22 14:57:02.674 -> 37 TSF:SID:OK,ID=22 14:57:02.674 -> 39 TSM:FPAR 75 TSF:MSG:SEND,22-22-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2082 !TSM:FPAR:NO REPLY 14:57:04.710 -> 2084 TSM:FPAR 2120 TSF:MSG:SEND,22-22-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4128 !TSM:FPAR:NO REPLY 14:57:06.751 -> 4130 TSM:FPAR 4166 TSF:MSG:SEND,22-22-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6174 !TSM:FPAR:NO REPLY 14:57:08.807 -> 6176 TSM:FPAR 6212 TSF:MSG:SEND,22-22-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 8220 !TSM:FPAR:FAIL 14:57:10.863 -> 8221 TSM:FAIL:CNT=1 14:57:10.863 -> 8223 TSM:FAIL:DIS 14:57:10.863 -> 8225 TSF:TDI:TSL 18227 TSM:FAIL:RE-INIT 14:57:20.837 -> 18229 TSM:INIT 14:57:20.837 -> 18236 TSM:INIT:TSP OK 14:57:20.837 -> 18238 TSM:INIT:STATID=22 14:57:20.871 -> 18240 TSF:SID:OK,ID=22 14:57:20.871 -> 18242 TSM:FPAR```
-
can't get DHT22 sensor to work with home assistant via mqtt gateway
pi@bereskapi-ha:~/MySensors $ sudo ./bin/mysgw Nov 04 06:26:41 INFO Starting gateway... Nov 04 06:26:41 INFO Protocol version - 2.3.1-beta Nov 04 06:26:41 DEBUG MCO:BGN:INIT GW,CP=RNNGL---,VER=2.3.1-beta Nov 04 06:26:41 DEBUG TSF:LRT:OK Nov 04 06:26:41 DEBUG TSM:INIT Nov 04 06:26:41 DEBUG TSF:WUR:MS=0 Nov 04 06:26:41 DEBUG TSM:INIT:TSP OK Nov 04 06:26:41 DEBUG TSM:INIT:GW MODE Nov 04 06:26:41 DEBUG TSM:READY:ID=0,PAR=0,DIS=0 Nov 04 06:26:41 DEBUG MCO:REG:NOT NEEDED Nov 04 06:26:41 DEBUG MCO:BGN:STP Nov 04 06:26:41 DEBUG MCO:BGN:INIT OK,TSP=1 Nov 04 06:26:41 DEBUG GWT:RMQ:MQTT RECONNECT Nov 04 06:26:41 DEBUG connected to 127.0.0.1 Nov 04 06:26:41 DEBUG GWT:RMQ:MQTT CONNECTED Nov 04 06:26:41 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT Nov 04 06:26:41 DEBUG TSM:READY:NWD REQ Nov 04 06:26:41 DEBUG TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK: Nov 04 06:27:16 DEBUG TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0: Nov 04 06:27:16 DEBUG TSF:MSG:BC Nov 04 06:27:16 DEBUG TSF:MSG:FPAR REQ,ID=1 Nov 04 06:27:16 DEBUG TSF:PNG:SEND,TO=0 Nov 04 06:27:16 DEBUG TSF:CKU:OK Nov 04 06:27:16 DEBUG TSF:MSG:GWL OK Nov 04 06:27:16 DEBUG !TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0 Nov 04 06:27:18 DEBUG TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0: Nov 04 06:27:18 DEBUG TSF:MSG:BC Nov 04 06:27:18 DEBUG TSF:MSG:FPAR REQ,ID=1 Nov 04 06:27:18 DEBUG TSF:CKU:OK,FCTRL Nov 04 06:27:18 DEBUG TSF:MSG:GWL OK Nov 04 06:27:18 DEBUG !TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0 Nov 04 06:27:20 DEBUG TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0: Nov 04 06:27:20 DEBUG TSF:MSG:BC Nov 04 06:27:20 DEBUG TSF:MSG:FPAR REQ,ID=1 Nov 04 06:27:20 DEBUG TSF:CKU:OK,FCTRL Nov 04 06:27:20 DEBUG TSF:MSG:GWL OK Nov 04 06:27:20 DEBUG !TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0 Nov 04 06:27:22 DEBUG TSF:MSG:READ,1-1-255,s=255,c=3,t=7,pt=0,l=0,sg=0: Nov 04 06:27:22 DEBUG TSF:MSG:BC Nov 04 06:27:22 DEBUG TSF:MSG:FPAR REQ,ID=1 Nov 04 06:27:22 DEBUG TSF:CKU:OK,FCTRL Nov 04 06:27:22 DEBUG TSF:MSG:GWL OK Nov 04 06:27:22 DEBUG !TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
my DHT22 sketch:
#include <DHT.h> #include <SPI.h> #define MY_DEBUG #define MY_RADIO_NRF24 #define MY_NODE_ID 22 #define CHILD_ID_TEMP 0 #define CHILD_ID_HUM 1 #define DHT_DATA_PIN 3 #define SENSOR_TEMP_OFFSET 0 #include <MySensors.h> /**************************************************/ /****************** CONSTANTS *********************/ /**************************************************/ static const uint64_t UPDATE_INTERVAL = 10000; static const uint8_t FORCE_UPDATE_N_READS = 10; /**************************************************/ /****************** VARIABLES *********************/ /**************************************************/ float lastTemp; float lastHum; float temperature; float humidity; uint8_t nNoUpdatesTemp; uint8_t nNoUpdatesHum; /**************************************************/ /****************** MESSAGES **********************/ /**************************************************/ MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); DHT dht; void presentation() { sendSketchInfo("DHT22", "1.0"); present(CHILD_ID_HUM, S_HUM); present(CHILD_ID_TEMP, S_TEMP); } void setup() { delay(2000); //Wait 2 seconds before starting sequence if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) { Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!"); } sleep(dht.getMinimumSamplingPeriod()); dht.setup(DHT_DATA_PIN); } void loop() { sendTemperatureHumiditySensor(); wait(UPDATE_INTERVAL); } /**************************************************/ /**************** AUX. FUNCTIONS ******************/ /**************************************************/ void sendTemperatureHumiditySensor() { dht.readSensor(true); temperature = dht.getTemperature(); humidity = dht.getHumidity(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT!"); } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) { lastTemp = temperature; nNoUpdatesTemp = 0; temperature += SENSOR_TEMP_OFFSET; send(msgTemp.set(temperature, 1)); #ifdef MY_DEBUG Serial.print("T: "); Serial.println(temperature); #endif } else { nNoUpdatesTemp++; } if (isnan(humidity)) { Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum || nNoUpdatesHum == FORCE_UPDATE_N_READS) { lastHum = humidity; nNoUpdatesHum = 0; send(msgHum.set(humidity, 1)); #ifdef MY_DEBUG Serial.print("H: "); Serial.println(humidity); #endif } else { nNoUpdatesHum++; } }