Mysensors service send_ir_ code sometimes doesnt function

i tried to find out the problem myselve but i am on the end.

every time i restart Hass i have to check if the service does function or not.
lots of times it does function, but more times it doesnt.
so i need to restart hass a few times before it functions.

i started debugging the mysensors.py in component/switches and i found out that when it doesnt function, devices are not passed to de service def.

the devices are there, i can turn the switch and then i get the turn on value in my arduino.
but if i try to send a value nothing is send because in the code there is no device turned on.

i hope that someone can help me with this because i really get frustrated from it.

maybe that @martinhjelmare can help me?

Do you have more than one gateway?

yes i got 1 serial and 2 ip gateways.

Thereā€™s a bug when using more than one gateway. List of devices is only available for one gateway. Should be easy to fix. Iā€™ll try to do it this weekend so it can make the next release.

1 Like

that explains why its getting worse over time here.
i added the second and third with quite some time in between.
i guess some period i got lucky and the right one got filled, and some period i got unlucky.

to bad i didnt contact you earlier. but i wasnt sure where the problem was.

Iā€™ve pushed a PR. If you can test that PR and report back, it would be great.

i would love to test is butā€¦

i found your
Fix mysensors overwriting gateway in GATEWAYS #4013
and tried to implement that.
that sadly gave me an error and i turned back to what i had.

this is based on the changes i found in there. so iā€™m afraid iā€™m not able to test it.

i have HA version 0.28 running and no idea how to testa pull, so i made a copie from the code from the components part from your gateway fix and then made a copy from this fix,

the error i get from the gateway fix :

16-11-28 21:06:44 homeassistant.bootstrap: Error during setup of component mysensors
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\homeassistant\bootstrap.py", line 102, in _setup_component
    result = component.setup(hass, config)
  File "C:\Python34\lib\site-packages\homeassistant\components\mysensors.py", line 135, in setup
    gateways = hass.data.get(MYSENSORS_GATEWAYS)
AttributeError: 'HomeAssistant' object has no attribute 'data'

Yeah, you have to checkout and test the full PR, if you donā€™t want to copy paste a lot of different files. Thereā€™s been changes since 0.28 in mysensors that depend on homeassistant core changes.

Although changing only the relevant lines could work. You can look at the changes tab in the PR, and just copy paste those green lines on top of the red lines.

how could i test the full PR easy with the option to go back if needed?
and off course then i get the problem from all other breaking changes since 0.28 (thats why i didnt update untill now, saw no reel advantage, but a lot off work :wink: )

i dont think i will make that all tonight, but i think its time that i update my second system and test it out there.

i have the latest hass version up and running on my rpi.
and then i made the new file and implemented that in hass.

first time running hass and it works. (off course i can only be sure after a few reruns and after i added some debugging lines)

so for now all seems fine.

thx, for the good work.

1 Like