jheling / freeathome

Free@Home component for Home Assistant
112 stars 41 forks source link

xmpp functionality #5

Closed lassem closed 5 years ago

lassem commented 5 years ago

Hi!

Reaching out via an Issue since there doesn't seem to be a better way.

I have added support for Free@Home thermostats; or partially at least. I can't get the updates coming back from the sysap. I've had it working before in https://github.com/lassem/freeAtHomeNibeLink and we also got it working in the openhab addon https://github.com/ruebox/openhab2-addons

Problem is that I am not very proficient in Python and I haven't used slixmpp before.

Any ideas?

I pushed the incomplete code to https://github.com/lassem/freeathome/pull/1

jheling commented 5 years ago

Hello, Sorry for the late reaction. Sometimes I also get the problem that free@home is not sending any information back. Mostly a reset of the free@home sysap will help for me. I will take a look at your code, maybe i can find something. Unfortunately I don't have the thermostat in my system.

lassem commented 5 years ago

I have got it working somewhat. I need to add the code that updates HA. If I could just figure out how to get slixmpp to work the way I want. Right now I am cheating by sending <presence><c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://slixmpp.org" ver="1.0"/></presence> using send_raw

Not sure how I can get slixmpp to expose the correct capabilities. You've already added the code that registers the needed objects afaict.

jheling commented 5 years ago

Hello Lasse,

I took a look at the changes you made. I saw some difference in the start procedure of the Client class. You have changed the order of the code and removed the line self .send_presence_subscription Maybe this is the reason you don't get any messages back. In my repository I also have the source get-master-message.py. This is a standalone program. I use this to retrieve the big xml with all the free@home devices and also to see if there are messages coming back from the sysap. These messages appear in the logging window. While testing this program myself, a minute ago, i noticed that the status messages were not being send by the sysap. Now the original Free@home does not get status messages either. Tomorrow i will try to find out if i can fix it. Best Johan.

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virusvrij. www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Op wo 26 dec. 2018 om 19:27 schreef Lasse Magnussen < notifications@github.com>:

I have got it working somewhat. I need to add the code that updates HA. If I could just figure out how to get slixmpp to work the way I want. Right now I am cheating by sending <c xmlns=" http://jabber.org/protocol/caps" hash="sha-1" node="http://slixmpp.org" ver="1.0"/> using send_raw

Not sure how I can get slixmpp to expose the correct capabilities. You've already added the code that registers the needed objects afaict.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jheling/freeathome/issues/5#issuecomment-450005362, or mute the thread https://github.com/notifications/unsubscribe-auth/AhkcvMXsb3V65spUDPMUZ_pwBTs4KqC1ks5u87-mgaJpZM4ZYcDx .

jheling commented 5 years ago

I have the status messages working again. It seems that using the same FAH user in different sessions confuses the FAH sysap. Now I have made a different user for each device, a FAH test user for my test raspberry, a FAH user for my normal raspberry. If i now use a FAH switch to turn on a light, Home Assistant wil get status message that the light is on.

I first disconnected all the session to the SYSAP and then did a new start of the sysap. After that i checked with the normal FAH webapp if the status messages were werking again. After that i actived the FAH component again in Home Assistant.

jheling commented 5 years ago

Hello Lasse, Did you manage to get the state messages of the thermostat working? Best, Johan

lassem commented 5 years ago

Have been on vacation. I will get back to you on this. I got the thermostats sending updates back via XMPP, but have yet to wire up the needed calls to HA.

lassem commented 5 years ago

I have updated PR (https://github.com/lassem/freeathome/pull/1). Still some things that needs a bit of work; when thermostats are off they report 35 deg. celsius f.ex.

But on a general note, the HASS UI doesn't update when turning on/off lights or adjusting the thermostats. I suspect there's some HASS state stuff that's missing, but I haven't had the time to look too much into it. Also, I really suck at Python so things are moving slowly.

It would've been great to finalize the component and maybe get it into the official distribution.

Let me know if you need my help. My Free@Home setup has quite a few components. No weather station though.

jheling commented 5 years ago

Hello Lasse, can you send me your email adress? You can reach me with 'helingj' on google mail. I want to show you how 'get-master-message.py' works on my free@home system

lassem commented 5 years ago

Closing as issue has been resolved.