Thx for your quick reply! I have some more remarks / questions in follow-up; (perhaps I can start some separate topics on some of these).
1. Polling speed
I can see the value of this direct switch functionality, but I would rather have the connection of input-to-output managed at a higher level (e.g. home assistant). Besides, the number of outputs on the L303 is not enough for that. Will have a look at the toggle function though!
Events instead of polling
I was also wondering whether there could be a simpler way to capture events from the SPI-interface. A lot of IoT solutions nowadays use protocols specifically for this, like MQTT; home assistant has a lot of support for it and e.g. arduino also has libraries for it. For my home automation setup, I would like to expand the number of IO and platforms, so something like MQTT has the added advantage to add more neurons that can run independently, but communicate directly with MQTT.
What would the best way to do this translation; I am thinking of:
- SPI polling: rather than having the modbus TCP server expose it, push the events out directly when they are found
- modbus TCP server polling: one layer higher, create an interface that connects the modbus TCP server with an MQTT broker
- PTY polling: on the same level, the SPI devices are also available through a PTY, so I could also have a similar interface between the PTY and an MQTT broker
- home assistant: write my own unipi-to-home-assistant integration -- but this would effectively do the same kind of polling as the hass modbus solution is doing right now
The fastest would probably be the SPI polling solution, directly connecting the polled SPI interface with an MQTT broker. I don't have that much experience with this low-level coding though, so it seems pretty hard. What are your thoughts on this? (perhaps I should move this to a separate topic)
On a related note, currently, the RPI seems to polling the SPI devices, but is there also a way to have the SPI devices directly trigger (interrupt?) the RPI? This seems even harder though and I am not sure whether there is that much advantage to it in practice.
2. Momentary switches
The toggle function is something I could indeed do perfectly at this level; no need to emulate this at a higher level such as home assistant.
I already tried to directly connect a 24VDC LED strip and toggle the DO, but this didn't seem to work. I'll probably need some more time to investigate it.
Lighting: DALI controller
For my lighting solution, I would actually like to build a DALI controller (yet another topic). The shop mentions the axon S605 to be suited for this, but I don't seem to be able to find any further documentation for this. Ideally, I would just have the axon run its own linux distro and have a common DALI library on it to interface with the DALI bus. I would then write my own MQTT client as a bridge between the DALI interface and the other unipi. Not sure how realistic this is though.
FYI, some background:
- I'm a software dev, currently mostly involved with python full-stack web development
- I have a background as an electrical engineer, with some experience in embedded software development and signal (image / audio) processing
- I'm currently in the process of building a house, so anything with respect to home automation is still possible atm. While much of the IoT solutions all focus on wireless solutions, I prefer wired solutions where possible.