Automatic control device with home assistant on raspberry

I am very happy with the home assistant application. I am working with a Raspberry Pi and home assistant is correctly installed. I’m controlling several devices. I would like to ask you for advice - would it be possible to send information to the Raspberry Pi? This info allows switches the device automatically. I am wondering if it would be possible to send 24 values from the HA app to the raspberry for each hour of the day to control a device under home assistant. If the value at a given hour is set 1, the device would be on. Otherwise the appliance would be switched off. I will send 24 values
Thank you very much.

How about mqtt?
You can set the server in home assistant ussing mosquitto add-on. Then instal mosquito client in the RPI and configure server connection and communication topic.

Yes I have installed mosquito and it is properly working but I don’t know how to configure the automatization into the home assistant. Imagine that the raspberry receive 23 zeros and one 1 in the first slot of a total slots of 24. It means that the appliance will be off all the time with the exception of the first one hour slot.

I’m not understanding you, sorry.

I’m spanish too, send me a pm explaining it if you want.

Hola, no logro la forma de enviar un mensaje privado.
Me gustaría enviar un vector de 24 slot a la raspberry (no sé si se puede configurar la aplicación de home assistant para esto). la raspberry recibiría este array de 24 slot. Si por ejemplo, este array es todo 0 salvo el último slot, El aparato solo se encenderá una hora, la última [000…0001]. ¿crees que home assistant podría hacer esta función y controlar el aparato de forma automática con cada vector que reciba por aparato? Gracias

I’m not sure if we can post in Spanish in this forum. To send a private msg, go to my profile and in upper right corner, you will see a blue button “message”

What I’m not understanding is if you want to turn on or off the PI or a device connected to de PI.

Assuming is a device connected to de PI, you need to set an automation that publishes by mqtt the desired values. I have in mind three approaches:

  • Send value by mqtt only on change. So you send a 1 and PI turn on device, after 23 hours send a 0 and PI turn off the device. This allow you to have better control, not only hourly, minutes or seconds also.
  • Send 1 or 0 each hour. PI will turn on or off device depending on value.
  • Send 24 numbers all together. Pi will store them and turn on or off device depending on values.

For me, best approach is the first one.

If it is about turning on or off the PI, you can have a look at Wake on LAN - Home Assistant for turning it on plus sending mqtt values.

Many thanks for your answer. I can not see the blue button maybe I suppose I have not enough privilege as I have just registered. Could you send me a private message and I will e mail you back?. I do not want to turn off the Pi, just the appliances that are connected to. Your first approach could be a posible but, If you want to turn on the device two times (i.e. 1am and 8 pm), this option could not be the optimal solution. The third approach seems to be the best option, but I don’t know how to implement it by using home assistant. Many thanks for your time and your info. Best