I’m struggling here with what I thought to be an easy thing to do. I’m trying to have an editable dinner menu, where I can type in the item and have it write to my database but then also continue to display it even after a restart. Currently I have home assistant OS on an HP Elite and the Maria DB and PHP add on. My lovelace card is written using input text helpers and use a python script to write the data to the DB when selecting the save button. Currently when I click the save button nothing happens. The timestamp for db updates only on a restart. But because it never wrote to the DB there is still nothing in the Lovelace card no the DB. If that makes sense. Does anyone have any ideas?
My thought was have one Lovelace card to write to the database and have it display the info on a different Lovelace card on the home page.
Any suggestions are welcome. I really want to put this simple project to rest so I can mount my tablet and move on lol
I currently have the Lovelace card set up with input text using a script and stuff. The problem I’m having is when I restart HA, they go blank. That’s why I was trying to use a DB, write to a table and have it load on restart.
I’m wondering if I should just have it update on Sunday mornings or something and then just put in the new menu after that.
It sounds like you need to read the values from your database after home assistant starts an write those values into input text helpers.
I’m having a hard time working out why you’re no just using 7 input text helpers, one go each day of the week. Or an input select that you store the meals in.
Forget the PHP, forget the script, just use 7 input text helpers, type the meals in. The values will survive a restart
I am using input text helpers. And it survives YAML reloads, not restarts after updates. That was before I started trying to use a database in home assistant. Now I have a database, a script and the exact same results.
Could I be doing something wrong with the input text? It seems like that’s straight forward enough to be able to mess that up.
If you have assigned an initial value property to the input text in the yaml, then that value would become the value of the input text when the system starts up.
I think that excluding input_text from the recorder may also prevent the values from surviving a restart.