Home Assistant v 0.11.1 with switch support
-
@martinhjelmare
Got that worked out, changed the Name in the Persistence File that HA created! :+1:
But it still does not show up.
HA Log:INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0:1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0:0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0:1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0:0 INFO:homeassistant.components.mysensors:update sensor_update: node 1Persistence File:
{"1": {"sketch_version": null, "children": {"3": {"type": 0, "values": {"16": "0"}, "id": 3}}, "sketch_name": "testgateway", "battery_level": 0, "sensor_id": 1, "type": 17}}I can't see anything obviously wrong with the persistence file, except for sketch version being null, although that is not used by HA. Try changing that to "1.0" and restart.
-
@martinhjelmare
Got that worked out, changed the Name in the Persistence File that HA created! :+1:
But it still does not show up.
HA Log:INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0:1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0:0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0:1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0:0 INFO:homeassistant.components.mysensors:update sensor_update: node 1Persistence File:
{"1": {"sketch_version": null, "children": {"3": {"type": 0, "values": {"16": "0"}, "id": 3}}, "sketch_name": "testgateway", "battery_level": 0, "sensor_id": 1, "type": 17}}Btw, your values are setup for a door sensor and not a switch. Maybe that was your intention?
-
@martinhjelmare
I Changed the Version, yet there is nothing added to the dashboard.
I used the sample BinarySwitch example sketch of MYS. The Sensor Arduino has a button connected to Pin 3.
I'm relativly new here so maybe I missed something. And I don't know what Values you mean. -
@martinhjelmare
I Changed the Version, yet there is nothing added to the dashboard.
I used the sample BinarySwitch example sketch of MYS. The Sensor Arduino has a button connected to Pin 3.
I'm relativly new here so maybe I missed something. And I don't know what Values you mean.Can you post your sketch and the complete log of HA after start? You can censor any sensitive info.
-
A clarification: In home assistant a switch is something you can turn on/off from home assistant, an actuator. The BinarySwitch example in mysensors examples is something you turn on/off by the node, a sensor.
It should work anyhow, but I was a bit confused at first. :smiley:
-
The Whole log is:
screenlog.txt
The Sketch is:
BinarySwitchSensor.ino
The Sketch was not modified and should be the same as the one of the MYS download Page.Do I maybe have to add anything to my config.yaml besides the plattform thing?
-
Unfortunately, I've realized this is a bug caused by me. There will be a bugfix release soon, so I hope we can have a fix for this in there. Sorry for the inconvenience!
Right now the binary sensors are missing in the sensor platform. I think it's due to me planning to do a binary sensor platform, but then changing my mind, and posponing that. Again sorry!
:anguished: -
Alright then, I started to feel a bit dumb :D
If you need any help let me know!
Thank you for looking into the issue :+1:Thanks for testing and reporting the problem. All feedback is very welcome and important, cause even though I try to test most scenarios, it's easy to miss something. In this case, though, I feel a bit embarrassed. :flushed:
I've submitted a tested pull request which fixes this, and it has already been merged. Hopefully the bugfix release will be live very soon.
-
Update: Bugfix release 0.11.1 is now out.
-
I'm not sure that the library provided with mysensors supports DHT21 (AM2301). The readme for DHT library only mentions "DHT11 and DHT22, AM2302, RHT03".
But I found this post, where the adafruit library is used together with mysensors:
http://forum.mysensors.org/topic/841/solar-powered-mini-weather-station/53As long as you get your temp/hum sensors going with the correct library there shouldn't be a problem of presenting them as mysensors sensors to home assistant.
-
Well I will look into, thank you!
I do not know if this is the right place for further problems, if not tell me.
I tried to remote control a relay today
I used the official sketch of MYS at https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/examples/RelayActuator/RelayActuator.inoEven though it Looks like they are properly connected, there is no switch appearing on HA-Dashboard.
Log of the Sensor-Arduino Running RelayActuator.ino:send: 1-1-0-0 s=255,c=0,t=18,pt=0,l=5,sg=0,st=ok:1.5.1 send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0 read: 0-0-1 s=255,c=3,t=6,pt=0,l=1,sg=0:M repeater started, id=1, parent=0, distance=1 send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=5,sg=0,st=ok:Relay send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0 send: 1-1-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,st=ok:Log of HA:
INFO:mysensors.mysensors:/dev/ttyUSB0 is open... INFO:mysensors.mysensors:Connected to /dev/ttyUSB0 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:gateway started, id=0, parent=0, distance=0 INFO:homeassistant.components.sensor:Updating sensor entities INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=0,t=18,pt=0,l=5,sg=0:1.5.1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:send: 0-0-1-1 s=255,c=3,t=6,pt=0,l=1,sg=0,st=ok:M INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=11,pt=0,l=5,sg=0:Relay INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=1,c=0,t=3,pt=0,l=0,sg=0: INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:homeassistant.components.device_tracker.nmap_tracker:Scanning INFO:homeassistant.components.device_tracker.nmap_tracker:No MAC address found for 192.168.2.111 INFO:homeassistant.components.device_tracker.nmap_tracker:nmap scan successful INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=0,t=18,pt=0,l=5,sg=0:1.5.1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:send: 0-0-1-1 s=255,c=3,t=6,pt=0,l=1,sg=0,st=ok:M INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=11,pt=0,l=5,sg=0:Relay INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=1,c=0,t=3,pt=0,l=0,sg=0: INFO:homeassistant.components.mysensors:update sensor_update: node 1``` -
Sorry, I forgot to ask, is it implemented yet? :D
I just scrambled through the code at HA
https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/switch/mysensors.py
and I could not detect the RELAY type. But than again I do not know alot of both of the systems, just guessing. -
Sorry, I forgot to ask, is it implemented yet? :D
I just scrambled through the code at HA
https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/switch/mysensors.py
and I could not detect the RELAY type. But than again I do not know alot of both of the systems, just guessing.You should send a value from the node child to set initial state also. I think that's what's missing.
Read my post here:
http://forum.mysensors.org/topic/2388/home-assistant-how-to-recognize-mysensors-nodes/27 -
@martinhjelmare
Would you mind to elaborate a bit more?
I am not sure how to alter the script. -
@martinhjelmare
Would you mind to elaborate a bit more?
I am not sure how to alter the script.For example:
... MySensor gw; MyMessage msgArray[NUMBER_OF_RELAYS]; for (int sensor=1; sensor<=NUMBER_OF_RELAYS;sensor++) { msgArray[sensor-1] = msg(sensor, V_STATUS); } void setup() { ... gw.begin(); for (int sensor=1; sensor<=NUMBER_OF_RELAYS;sensor++) { gw.present(sensor, S_BINARY); gw.send(msgArray[sensor-1].set(0)); } ... }If you don't need to send any more messages after the setup funtion, ie access the message variables in the array anywhere else, you can move the assigning of the array in the first for loop to the second for loop in the setup function, to avoid code duplication.
You need to send at least one value per child to populate all data structures in home assistant.
Edit: You can actually move the assigning of the array and only have one for loop, inside the setup funtion, anyhow, since the array is initialized separately outside the functions.
-
I have installed 0.11.1 and added the lines to configuration.yaml, but my sensors are bit showing in ha itself. The ID of the nodes is being passed to ha in the log, but nothing else. Trying to set to a pir, temp/humid, and relay switches.
-
I have installed 0.11.1 and added the lines to configuration.yaml, but my sensors are bit showing in ha itself. The ID of the nodes is being passed to ha in the log, but nothing else. Trying to set to a pir, temp/humid, and relay switches.
Please show me the home assistant log. I can't really say anything useful without it.
-
here is the output from /home/pi/.homeassistant/home-assistant.log:
6-01-24 15:08:16 netdisco.ssdp: Found malformed XML at http://192.168.86.142:9080: status=okThis is my configuration.yaml
homeassistant: # Name of the location where Home Assistant is running name: Home # Location required to calculate the time the sun rises and sets latitude: longitude: # C for Celcius, F for Fahrenheit temperature_unit: C # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones time_zone: America/Halifax # Enables the frontend frontend: # Checks for available updates updater: # View all events in a logbook logbook: # Track the sun sun: # Enables support for tracking state changes over time. history: # Show links to resources in log and frontend #introduction: # Allows you to issue voice commands from the frontend conversation: # Discover some devices automatically discovery: # Webcams camera 1: platform: mjpeg mjpeg_url: http://192.168.86.117:10012/videofeed name: LivingRoom Camera username: root password: groot # Squeezebox Server media_player 1: platform: squeezebox host: 192.168.86.113 port: 9090 # MySensors Serial Gateway mysensors: gateways: - port: '/dev/ttyUSB0' persistence_file: '/home/pi/.homeassistant/mysensors.json' # debug: true persistence: true version: '1.5'Would it be because my nodes are set for manual ID and not auto?