And how about the UI-State of the entity? Is it correctly displayed as on or off?
yes it is displayed correctly, but for IT devices you’ve got no status communication like homematic does. So if send command fails the UI shows “on” but the switch is off, for example. Had that before in FHEM, but it’s an Intertechno “problem”.
Ok, so it is already working like it should, with the limitation of not knowing if the state is really correct, but that is not part of the functionality anyways for IT devices.
Hence we could start adding IT devices to pyhomematic right away if we can confirm they are working. Do you have other IT devices which we could integrate?
I’ve got an CMR 500 cover actor, never used it before cause I’m on Homematic Devices.
http://intertechno.at/front/produkte/empfanger/jalousien/cmr-500/
The one I have looks slightly different (as far as I remember at least), so I think it would be worth it to at least have a look at it if you don’t mind the effort.
The way HomeMatic cover actors work is by sending a float-value from 0.0 to 1.0 as the value for STATE
. So you could do exactly the same as above on the Python shell, but instead of True
you pass a something like 0.5
, which would relate to 50% open. Since you probably don’t have the device hooked up it would probably be enough to just attach a lamp or similar. It should be glowing while the actor drives from position A to position B.
Edit: I just had a look. It’s an ITL-500 what I have. So if we both manage to get the actors working we already cover all IT actors of this kind that are available.
something seems to be changed, can’t figure out what exactly went wrong now.
2017-10-24 21:06:38 ERROR (Thread-3) [pyhomematic.devicetypes.generic] HMGeneric.getValue: WORKING on ITD00000221:1 Exception: <Fault -5: ‘Unknown parameter.’>
2017-10-24 21:06:38 ERROR (Thread-2) [pyhomematic.devicetypes.generic] HMGeneric.getValue: WORKING on ITD00000297:1 Exception: <Fault -5: ‘Unknown parameter.’>
2017-10-24 21:06:38 ERROR (Thread-4) [pyhomematic.devicetypes.generic] HMGeneric.getValue: WORKING on ITD0000011B:1 Exception: <Fault -5: ‘Unknown parameter.’>
Does the switch still work? My guess would be, that even though the IT switch generally behaves like a HM switch, it has not all properties. WORKING is such a property that would be missing. For HM devices this could indicate an error. For IT devices it probably just can be ignored.
Yes, it’s still working. But I have observed that it doesnt seem to work the whole time… not sure why.
Did you upgrade HASS to the latest version? (0.56)
The switch should work out of the box with that version without any modifications in pyhomematic.
And are you sure you didn’t have those errors before? I assume these only show up when you start HASS, since that’s the time where the device is actively asked about all usable parameters. After that it’s always the CCU/Homegear that tells HASS what the current state is, which in case of IT switches should never happen for the WORKING
parameter.
Regarding the unreliability: What does the Homegear log say?
Updated HASS to 0.56 an it’s working right now. You are right, errors are only shown on HASS start procedure.
Sometimes the switches can’t be switche but i guess it’s a poor signal issue because of the distance CUL <-> switch.
Today I have set up Homegear + CUL and added my cover actuator (ITL-500). At least in my case Homegear handles it as a switch, so it already is controllable via HASS. But for now I don’t know how useful it is. I have just plugged it into the power and can hear it clicking. I guess that’s what it is supposed to do.
if you hear it clicking, it’s seems to be working thats the way I prove the functionality of the switches; hit the button and just listen
Hi @danielperna84, i’ve buyed a cheap Smartwares SmartHome Funk-Bewegungsmelder, SH5-TSO-A also known as Home Easy HE851 Motion Detector (433 MHz). My Homegear instance with nanocul attached sees the device:
06/06/18 03:22:34.912 Intertechno packet received from 00000000 (RSSI: -72 dBm):
06/06/18 03:22:35.219 Intertechno packet received from 00000000 (RSSI: -72 dBm):
06/06/18 03:22:35.509 Intertechno packet received from 0000031D (RSSI: -74 dBm): FF
06/06/18 03:22:35.510 Module Intertechno: Info: STATE on channel 4 of peer 10 with serial number ITD00000018 was set to 0x01.
06/06/18 03:22:35.509 Please use one of the following addresses for device creation: Intertechno multi-channel remote or sensor (use device type 0x33): 0x00C3; Intertechno one channel remote or sensor (use device type 0x30): 0x00C7; Elro (use device type 0x24): 0x0018
I could successfully pair the Motion Detector with Home Gear. How can i create an entity in Home Assistant and show the device in the web interface?
edit:
When motion gets detected following is written in home-assistant.log:
2018-06-06 03:30:51 DEBUG (Thread-3) [pyhomematic._hm] RPCFunctions.event: interface_id = homeassistant-rf, address = ITD00000018:4, value_key = STATE, value = False
2018-06-06 03:30:51 INFO (Thread-3) [pyhomematic.devicetypes.generic] HMGeneric.event: address=ITD00000018:4, interface_id=homeassistant-rf, key=STATE, value=False
For your device to work it needs to be implemented in pyhomematic and Home Assistant. To do this you would need to turn the log level of Home Assistant to debug, and while starting up look for a message related to your device that looks like this:
2017-09-28 16:57:32 DEBUG (Thread-2) **[pyhomematic._hm] RPCFunctions.createDeviceObjects: created ITD00000221 as UNSUPPORTED device for IT-Switch**
To add support I would need to know how your device is referred to in Homegear. So just copy the complete line that matches the example.
Here it is:
DEBUG (Thread-3) [pyhomematic._hm] RPCFunctions.createDeviceObjects: created ITD00000018 as UNSUPPORTED device for Elro-AB440-Remote
Thank you.
It will take me some time to dive deeper into this. If you want to you can try it yourself. The implementation for pyhomematic would be done here: https://github.com/danielperna84/pyhomematic/blob/master/pyhomematic/devicetypes/sensors.py
Since it looks like channel 4 is being used I would copy the existing Motion
class and call it SmartwareMotion or something like that. You would need to also add the ELEMENT-property with the channel 4, which regular motion detectors don’t need because the default channels work for them.
All the way at the bottom you then have to add an entry like "Elro-AB440-Remote": SmartwareMotion
.
For Home Assistant you then have to add the new SmartwareMotion class here.
Thank your for that @danielperna84
Do you have an example for the ELEMENT-Property? Another class as example?
Thank you.
Edit:
I edited the files. The sensor gets created:
RPCFunctions.createDeviceObjects: created ITD000000C7 as SUPPORTED device for IT-Old-Remote-1-Channel
(I’ve readded the device in homegear and defined it as IT-Old-Remote-1-Channel device, since it only detects motion)
When motions gets detected, following lines gets created in home-assistant.log:
2018-06-08 00:28:49 DEBUG (Thread-3) [pyhomematic._hm] RPCFunctions.event: interface_id = homeassistant-rf, address = ITD000000C7:0, value_key = RSSI_DEVICE, value = -184
2018-06-08 00:28:49 INFO (Thread-3) [pyhomematic.devicetypes.generic] HMGeneric.event: address=ITD000000C7:0, interface_id=homeassistant-rf, key=RSSI_DEVICE, value=-184
2018-06-08 00:28:49 DEBUG (Thread-3) [pyhomematic._hm] RPCFunctions.event: interface_id = homeassistant-rf, address = ITD000000C7:1, value_key = STATE, value = True
2018-06-08 00:28:49 INFO (Thread-3) [pyhomematic.devicetypes.generic] HMGeneric.event: address=ITD000000C7:1, interface_id=homeassistant-rf, key=STATE, value=True
2018-06-08 00:28:49 DEBUG (Thread-3) [pyhomematic.devicetypes.generic] HMDevice.event: Using callback <bound method HMDevice._hm_event_callback of <Entity MotionDetect01 MOTION: off>>
2018-06-08 00:28:49 DEBUG (Thread-3) [homeassistant.components.homematic] MotionDetect01 MOTION received event 'STATE' value: True
2018-06-08 00:28:54 DEBUG (Thread-3) [pyhomematic._hm] RPCFunctions.event: interface_id = homeassistant-rf, address = ITD000000C7:1, value_key = STATE, value = False
2018-06-08 00:28:54 INFO (Thread-3) [pyhomematic.devicetypes.generic] HMGeneric.event: address=ITD000000C7:1, interface_id=homeassistant-rf, key=STATE, value=False
2018-06-08 00:28:54 DEBUG (Thread-3) [pyhomematic.devicetypes.generic] HMDevice.event: Using callback <bound method HMDevice._hm_event_callback of <Entity MotionDetect01 MOTION: off>>
2018-06-08 00:28:54 DEBUG (Thread-3) [homeassistant.components.homematic] MotionDetect01 MOTION received event 'STATE' value: False
Unfortunately there is no event i can reuse as an automation. How can i solve this?
Do I understand correctly, that the name of the device type is not pre-defined by Homegear? That would be a requirement for others to use this device. As you can see in the code, specific device types point to a specific Python class. If you’re free to choose whatever name you want, then we have no proper way to correctly identify the devices.
Besides that, you should not need to listen for events. If you have implemented your device in Home Assistant (the second link I have posted) as IT-Old-Remote-1-Channel
, then you should get a native Home Assistant entity (binary_sensor) which state is either on or off. That should switch every time you see the value = True/False
in the log.
Homegear lets you chosse:
06/06/18 03:22:35.509 Please use one of the following addresses for device creation: Intertechno multi-channel remote or sensor (use device type 0x33): 0x00C3; Intertechno one channel remote or sensor (use device type 0x30): 0x00C7; Elro (use device type 0x24): 0x0018
I’ve seen that home assistant has created an entity automatically …
… but it does not change the state on motion. Can i provide you some other logs for investigation?
After your change in Homegear the channel seems to have changed as well.
In your initial log-output it said channel 4. In the last log you have posted it’s channel 1, like regular motion detectors.
What I’m referring to is this line:
2018-06-08 00:28:54 INFO (Thread-3) [pyhomematic.devicetypes.generic] HMGeneric.event: address=ITD000000C7:1, interface_id=homeassistant-rf, key=STATE, value=False
The part with ITD000000C7:1
is the combination of the device address + channel (the last part after the colon is the channel). So if you change the code in pyhomematic to use channel 1, the state of the entity might properly update. You Could probably also remove your new class and instead let IT-Old-Remote-1-Channel
point at the Motion
class.
The big qustion for implementing this into pyhomematic would be how we could practically assign the IT-Old-Remote-1-Channel
to the Python classes. Or is the IT-Old-Remote-1-Channel
automatically generated by selecting one of the 0x...
values? That part still is not clear to me.