sorry i forgot to check on the size… yes it sounds like it, i removed everything i could , the buzzer etc. then add back as i trim my code. do as much in the tft as possible like buttons which have 2 state images without having to assign them in the yaml etc & do as much with automations within HA instead of the yaml. it’s a real shame on the memory limitations.
edit: don’t forget to clean build files after removing components as it will remove unnecessary libs etc
edit 2: mine is definitely 68.4%, i just checked. maybe something else is going on.
Mine is currently 68.7% (?) and I can still OTA update it.
This time I just compiled to binary to check the size, but it worked fine when I OTA updated it a few hours ago.
I’ve found your config very useful and I’ve put together a radio player page similar to yours. I’ve three devices (two are Sonos, the other is a Google home) I want to use and so I’ve put together the following page that includes 3 buttons to select the device I want the page to work for (it’s a work in progress and I’ll tidy it eventually). I’ve a few issues I wonder if you can help with. I’ll explain my approach first.
Selecting which device is done by tapping on the media buttons which updates an HA helper input_select.media_device which I use to track what I’ve selected. The bg colour of the selected media is yellow and can be changed when tapped (or when updated in HA). Then, when any of the radio buttons is tapped an automation is triggered in HA to action the request (exactly as you did).
I use Node Red for my automations and I’ve set up two, one for the radio selection and one for the volume selection as shown below (as an aside, I don’t know how I’d do it using HA standard automations). I reset the booleans in Node Red rather than my nspanel yaml. Hopefully they’re reasonably clear.
This works (and this approach means I can easily add buttons to Lovelace to do the same) but there are a few issues I’d like to iron out:
I can’t use the media_player.media_play_pause service for play/pause, it doesn’t work for any of my devices. I have to use media_player.volume_mute which is a bit naff!
I can’t get any song titles etc for any of my devices.
When the page is opened on the nspanel, the current device selection doesn’t update automatically. I have to have a periodic updater (I use every 1s) to update the page. [This is actually a general issue I have on my pages; I’ve an ever growing set of nested if then elses in this every 1s section to ensure a page shows current information as soon as it’s displayed. It’d be more efficient if I could force an update of a page on its selection.]
I would like to use esphome for my nspanel. I flashed it. I used several nspanel.yaml files and several tft files.
upload and connecting to HA works fine.
When I press a button (not the two at the bottom, not gpio) HA sees and on AND off action. seems logical for binary_sensor. How can I use them for On and Off button. preferably with changing the icon on the panel.
I used lovejoy777, I used MarKWattTech and ofcourse Marcfager. all with the same effect.
I get empty buttons on my panel and no switches in HA only sensors.
thanks to all the hard workers ho are sharing there work
How do I change the font color based on a sensor?
I have a HA sensor that gives me two possible states 63488 or 65535 and I figured I could push that in to the pco attribute of a text field
/config/esphome/ns-kitchen.yaml: In lambda function:
/config/esphome/ns-kitchen.yaml:561:103: warning: format '%s' expects argument of type 'char*', but argument 4 has type 'double' [-Wformat=]
- lambda: id(disp1).set_component_text_printf("Thermostat.temp.pco", "%s", id(selected_thermostat_heating).state);
And the panel got unstable and couldn’t even maintain the main screen so I had to revert back.
What should the ESP-Home code be?
thanks for your quick reply. this looks like it would solve one off the issues. I think I would first have to change the binary_sensor to a switch. I my yaml file I only have sensors. Ithink I can change the pic in the HMI (tft) file to a Dual-state button. How do I tell HA it is a button (switch)
The pco attribute isn’t a text field. Look at what I did above for BGimg. Replace it with, say, TXTpco and set it to 63488 or 65535 depending on the the state value of your entity. Then use my lambda call but updated with your page and variable.
pedro my artist and song names don’t work when i use my radio channel buttons to open the url’s, i have a Google mini as my media player and the artist and title get displayed if i ask the mini to play it, but with the button url it doesn’t in my GitHub readme it explains it. as for you not updating without calling for the update i don’t know, i use on_value with all mine so they just update automatically whenever there is a change.
edit: sorry I’ve never used node_red either.
edit2: i also don’t get mute working on mine but pause/play does i think it’s a little hit and miss with what is supported with esphome, HA & your media player. obviously all 3 have to work together
your example looks so simple.
I changed entity_id: to an existing light in HA. that should do the trick I guess. But still nogo.
I changed 1 button to on_release ( in my yaml it was on_click)
I added then:
Try going into HA, go to Developer Tools, at the top click on SERVICES.
Then try and use the toggle service on your entity. In the UI mode you simply have to start typing “toggle” to get the service and then you choose your entity. Then click on the call service button which should toggle your light. There’s an option to go between yaml and UI mode which shows you how HA is seeing things. This should enable you to track down the precise naming you should be using.