Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: evohome-listener - some questions

  1. #11
    Automated Home Sr Member
    Join Date
    Feb 2018
    Posts
    57

    Default

    Great piece of work @zxdavb! Had I seen yours before, I wouldn't have bothered doing the evolistener script, and would have just used yours as the basis for what I need!

    Would you consider hooking it up to MQTT, so that other home automation systems (e.g. openHAB) can also use it?

  2. #12
    Automated Home Sr Member
    Join Date
    Jan 2018
    Posts
    52

    Default

    Thanks.

    I started mine less than a year ago - so still suffering from teething problems - even this week, I am still learning new things about the packets / the protocol - but I think I got it sorted now. It just took ages to work a lot of things out - like when the first two bytes of a payload are for zone 0, or they just null bytes!

    I would implement MQTT/Node-RED/etc. - I am just too short of time - I think it's going to take another year to get evohome_cc working for HA (and it exposes issues in evohome_rf).

    It is designed as a library to be used by a (wrapping) client - it includes a very basic client.py as a CLI. It is completely async, and includes QoS (Throttling, Priority, Retries) when transmitting packets and I could easily enough set it up to expose itself as a transport, then you can do anything by writing a wrapper as a protocol and have the benefits of callbacks.

    I am keen to help people do this.

    If you'd like to collaborate, then I'd be could implement the transport sooner rather than later. Then you just have to have code like below.

    You could replace all your packet/payload processing with:
    Code:
    def self._mgtt_callback(msg.payload):
        ...
    where msg.payload is a simple dict.

    This is the full protocol. You send command to send_data, and receive messages at mqtt_callback.

    Code:
    class EvohomeProtocol(asyncio.Protocol):
        def __init__(self, mqtt_callback) -> None:
            self._transport = None
            self._pause_writing = None
            self._mqtt_callback = mqtt_callback
    
        def connection_made(self, transport: SerialTransport) -> None:
            """Called when a connection is made."""
            self._transport = transport
    
        def data_received(self, msg):
            """Called when some data is received."""
            self._mqtt_callback(msg.payload)
    
        async def send_data(self, command) -> None:
            """Called when some data is to be sent (not a callaback)."""
            while self._pause_writing:
                asyncio.sleep(0.1)
    
            await self._transport.write(command)
    
        def connection_lost(self, exc: Optional[Exception]) -> None:
            """Called when the connection is lost or closed."""
            if exc is not None:
                pass
            self._transport.loop.stop()
    
        def pause_writing(self) -> None:
            """Called when the transport's buffer goes over the high-water mark."""
            self._pause_writing = True
    
        def resume_writing(self) -> None:
            """Called when the transport's buffer drains below the low-water mark."""
            self._pause_writing = False
    Last edited by zxdavb; 5th November 2020 at 10:45 PM.

  3. #13
    Automated Home Legend
    Join Date
    Sep 2014
    Location
    Scotland
    Posts
    2,183

    Default

    Evohome hackers untie!

    No, unite!

  4. #14
    Automated Home Sr Member philchillbill's Avatar
    Join Date
    Jan 2017
    Location
    Eindhoven, Holland
    Posts
    82

    Default

    If I were to run evohome_rf with my hgi80, does it have to have exclusive access to the hgi80 or would it be OK to have Domoticz also butting in from time to time with its own serial access to the hgi80? Is there any 'hold_off' functionality, as it were?

  5. #15
    Automated Home Sr Member
    Join Date
    Feb 2018
    Posts
    57

    Default

    Quote Originally Posted by zxdavb View Post
    Thanks.

    If you'd like to collaborate, then I'd be could implement the transport sooner rather than later. Then you just have to have code like below.
    That would be great! No urgency though, as I am a bit tied up with some work at the moment, and may not be able to give much time at the immediate moment, but definitely something worth doing. Please do keep me posted, whether here or maybe better on github?

  6. #16
    Automated Home Sr Member
    Join Date
    Jan 2018
    Posts
    52

    Default

    Quote Originally Posted by philchillbill View Post
    If I were to run evohome_rf with my hgi80, does it have to have exclusive access to the hgi80 or would it be OK to have Domoticz also butting in from time to time with its own serial access to the hgi80? Is there any 'hold_off' functionality, as it were?
    No, exclusive. The was a plan to provide this feature, but no-one wanted to test it for me. TBH, the nanoCUL dongles are 25 or so, so that would be the way forward.

  7. #17
    Automated Home Sr Member
    Join Date
    Jan 2018
    Posts
    52

    Default

    Quote Originally Posted by smar View Post
    That would be great! No urgency though, as I am a bit tied up with some work at the moment, and may not be able to give much time at the immediate moment, but definitely something worth doing. Please do keep me posted, whether here or maybe better on github?
    Ping me via github, whenever.

  8. #18
    Automated Home Sr Member philchillbill's Avatar
    Join Date
    Jan 2017
    Location
    Eindhoven, Holland
    Posts
    82

    Default

    Quote Originally Posted by zxdavb;
    No, exclusive. The was a plan to provide this feature, but no-one wanted to test it for me. TBH, the nanoCUL dongles are 25 or so, so that would be the way forward.
    Ok, thanks. If you want somebody to test the shared access, let me know. I want to run the DanD Python script that queries/changes the Evohome schedule over RF and things go wrong when Domoticz accesses my HGI80 too.

  9. #19
    Automated Home Sr Member
    Join Date
    Feb 2018
    Posts
    57

    Default

    Quote Originally Posted by zxdavb View Post
    Ping me via github, whenever.
    Thans and will do.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •