For you Python programmers: (evohome_rf) provides all sorts of advantages, including discovery, tracking state, QoS, and the most complete set of parsers.
Here, we discuss using it to eavesdrop the RAMSES protocol (you can send commands too).
Perhaps you want to write an MQTT or a node-RED wrapper?
You can use evohome_rf as an async transport: a template protocol is provided, via a protocol_factory, create_client().
I think an example says it all:
In this case, process_message is your own callback, and you can put anything in there (such as dispatching to MQTT):
The output of the above will look like:
Here, we discuss using it to eavesdrop the RAMSES protocol (you can send commands too).
Perhaps you want to write an MQTT or a node-RED wrapper?
You can use evohome_rf as an async transport: a template protocol is provided, via a protocol_factory, create_client().
I think an example says it all:
Code:
import asyncio from evohome_rf import Gateway def process_message(msg) -> None: print(f"{msg.dtm} {msg}") async def main(loop, serial_port, **config): if sys.platform == "win32": # YMMV: ERROR:asyncio:Cancelling an overlapped future failed asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) config = {"reduce_processing": 1} gwy = Gateway(serial_port, loop=loop, **config) protocol, _ = gwy.create_client(process_message) try: await asyncio.create_task(gwy.start()) except asyncio.CancelledError: pass loop = asyncio.get_event_loop() loop.run_until_complete(main(loop, "/dev/ttyUSB0")) loop.close()
Code:
def process_message(msg) -> None: {print(k, v) for k, v in msg.payload.items()}
Code:
2020-11-08 21:06:55.241989 || TRV:189082 | CTL:145038 | I | setpoint | 06073A || {'parent_idx': '06', 'setpoint': 18.5} 2020-11-08 21:06:55.256636 || TRV:189082 | CTL:145038 | I | window_state | 060000 || {'parent_idx': '06', 'window_open': False} 2020-11-08 21:07:21.556830 || STA:136285 | | I | temperature | 0007A3 || {'temperature': 19.55} 2020-11-08 21:08:50.299288 || STA:064023 | | I | temperature | 0007AB || {'temperature': 19.63} 2020-11-08 21:08:54.714936 || CTL:145038 | | I | system_sync | FF073F || {'remaining_seconds': 185.5, '_next_sync': '21:12:00'}
Comment