Hello all,
I am relatively new to homeassistant, coming from FHEM. So far I am very enthusiastic about the functionality and the huge amount of integrations and adons.
I am running HAOS on a RPI5 with 512GB SSD.
I would need some help with a very special topic:
I have the 1-wire integration running with a DS2408 8-bit IO port whom I am interfacing with an Arduino Nano.
I want to be able to send a byte-value from homeassistant via 1-wire to the DS2408 and do something with this value inside the Nano.
I need the 1-wire connection since WLAN is no choice in this case.
The issue is, that the 1-wire-integration in homeassistant has not implemented the command “PIO(BYTE)” which the DS2408 originally supports.
I have only 8 entities for each port bit with a value of on or off.
I have already read a lot and I think I have to define a template where the calculations from a byte value to the 8 port bits could be done.
Could anyone with more knowledge about the Jinja language give me some hints how I could solve my problem?
If I am on the wrong track with my template approach, I would be happy to get some different advice.
Are you looking to take 8 entities and make it into 1 or vice versa? I’m not following your explanation. Please post an example of your source entity and it’s state.
the source entity is a byte value which I intend to decrease from 255 to 0 based on time of day (sunrise => 0, sunrise+1 minute => 1, … sunrise+255 minutes => 255)
The destination are 8 binary switches which represent the byte value:
The overall purpose is, to dimup a grow light in a greenhouse in the morning and dimdown in the evening. This is done by the Arduino Nano, connected to the DS2408 with 8 port bits.
I have only the 1-wire connection available, therefore this “not straight forward” approach.
Hope this clarifies my intention.
I2C, SPI, or actually 1-wire? Can’t you use serial, something common across pretty much everything? Is the DS2408 necessary? Can’t you just use 8 GPIOs on the remote end on your Nano?
Make and model please, so I can understand your challenge better.
@petro: thank you very much for your help; I have to dig into this to understand since as I said I am not a Jinja-Specialist; most probalby I willl come back with some questions
@IOT7712:
I tried to draw a diagram how my setup is; hope that helps to clarify.
The 1-wire line is buried in my garden and the DS2408 and the Arduino is in a waterproofed case in my greenhouse and I do not want to touch this setup