Can you post the automation automation.hasp_haswitchplate_3_p2_weather
?
Finally putting page 9 to some useā¦
edit: waffling on the icons in use here. The top number in black (72Ā°) is the current temperature. The red number below it is the target_temp_high
, while the blue number below that is target_temp_low
. The trouble w/ the fire and snow icons is that the fire icon is for the AC setting, while the snow icon is for the heater setting. Feels a little offā¦
Hereās an alternative:
Thoughts?
Gee @luma I have a thought - why the heck is the Ā° on the left side of the number?
How about this:
Hi Luma, Thanks for the reply. They should be the same except for device number as I did a cut and past the try to remove any errors. (but would be the first [or last] time I screw upā¦)
This is hasp_haswitchplate_2_p2_weather.yaml
##############################################################################
# Automations to display the weather forecast and current temp on page 2
automation:
# Display weather details on page 2 when weather updates or on HASP init
- alias: hasp_haswitchplate_2_p2_Weather
trigger:
- platform: state
entity_id: weather.nws
- platform: state
entity_id: 'binary_sensor.haswitchplate_2_connected'
- platform: homeassistant
event: start
condition:
- condition: state
entity_id: 'binary_sensor.haswitchplate_2_connected'
state: 'on'
action:
- service: mqtt.publish
data:
topic: 'hasp/haswitchplate_2/command/p[2].b[6].font'
payload: '3'
- service: mqtt.publish
data:
topic: 'hasp/haswitchplate_2/command/p[2].b[6].txt'
payload_template: '"{{state_attr("weather.nws","temperature")|int}}Ā°F"'
- service: mqtt.publish
data:
topic: 'hasp/haswitchplate_2/command/p[2].b[7].font'
payload_template: '{% if states.weather.nws.state|length <= 6 -%}3{% elif (states.weather.nws.state|length > 6) and (states.weather.nws.state|length <= 10) %}2{% elif (states.weather.nws.state|length > 10) and (states.weather.nws.state|length <= 15) %}1{% else %}0{%- endif %}'
- service: mqtt.publish
data:
topic: 'hasp/haswitchplate_2/command/p[2].b[7].txt'
payload_template: '"{{states.weather.nws.state|wordwrap(20, wrapstring="\\r")|title}}"'
This is for hasp_haswitchplate_3_p2_weather.yaml
##############################################################################
# Automations to display the weather forecast and current temp on page 2
automation:
# Display weather details on page 2 when weather updates or on HASP init
- alias: hasp_haswitchplate_3_p2_Weather
trigger:
- platform: state
entity_id: weather.nws
- platform: state
entity_id: 'binary_sensor.haswitchplate_3_connected'
- platform: homeassistant
event: start
condition:
- condition: state
entity_id: 'binary_sensor.haswitchplate_3_connected'
state: 'on'
action:
- service: mqtt.publish
data:
topic: 'hasp/haswitchplate_3/command/p[2].b[6].font'
payload: '3'
- service: mqtt.publish
data:
topic: 'hasp/haswitchplate_3/command/p[2].b[6].txt'
payload_template: '"{{state_attr("weather.nws","temperature")|int}}Ā°F"'
- service: mqtt.publish
data:
topic: 'hasp/haswitchplate_3/command/p[2].b[7].font'
payload_template: '{% if states.weather.nws.state|length <= 6 -%}3{% elif (states.weather.nws.state|length > 6) and (states.weather.nws.state|length <= 10) %}2{% elif (states.weather.nws.state|length > 10) and (states.weather.nws.state|length <= 15) %}1{% else %}0{%- endif %}'
- service: mqtt.publish
data:
topic: 'hasp/haswitchplate_3/command/p[2].b[7].txt'
payload_template: '"{{states.weather.nws.state|wordwrap(20, wrapstring="\\r")|title}}"'
Does manually triggering hasp_haswitchplate_3_p2_Weather
produce any MQTT output or log any errors?
Just the one I posted above
Logger: homeassistant.components.automation
Integration: Automation (documentation, issues)
First occured: 8:58:39 AM (1 occurences)
Last logged: 8:58:39 AM
Error while executing automation automation.hasp_haswitchplate_3_p2_weather. Error rendering template for call_service at pos 4: UndefinedError: āNoneā has no attribute āstateā
Sorry. Not sure what is manually trigger. Switching to that page? or using
hasp_haswitchplate_2_p2_Weather switch in UI?
Just found that _2 does not find a Switch Plate:
http://192.168.123.23:8123/haswitchplate_1 - Finds SP info (Widi ssid, Wifi name, HASP node name etc)
http://192.168.123.23:8123/haswitchplate_2 - No SP info (We canāt connect to the server at haswitchplate_2.)
http://192.168.123.23:8123/haswitchplate_3 - Finds SP info (Widi ssid, Wifi name, HASP node name Tried removing power and rebooting _2 and _3. Found an issue (had missed this).
HASwitchPlate _1 192.168.123.102 - Has weather info 30 degs
HASwitchPlate _2 192.168.123.103 - Has weather info 34 degs
HASwitchPlate _3 192.168.123.104 - Has NO weather info
So _1 and 2 are looking at different weather sites. I was using weather.home but all switched to weather.nwsā¦ Confirmed in hasp_haswitchplate*_p2_weather.yaml for each device.
This is amazing. Canāt wait for this.
This looks great! I like the thermometers more than the fire/snowflake.
What about a page to control a ceiling fan? Top button turns the light on/off. Then 4 smaller buttons in a square to turn the fan off, low, medium, high?
Thatās the one. Where do I get it for my HASP? I already have one for HA.
Well since youāve asked so nicelyā¦
Anyone want to beta test v0.40?
I feel like Iāve nailed down the new features and the demo automations to utilize them. There have been a HUGE number of changes to the project since the last release, which means Iāve fixed some bugs and probably made some new ones. Given all the new stuff, for this cycle I want to give some intrepid users the opportunity to test the new release out before officially publishing the release.
Device firmware
Open the web interface on your HASP and navigate to the firmware update page. Paste in the following URLs to update the ESP8266 and LCD firmware. The order shouldnāt matter. The LCD firmware is now nearly 10x bigger than it used to be (yay fonts!), so expect it to take 10x longer to apply. If you have access to the SD card the process is a lot faster.
Beta ESP8266 firmware URL: http://haswitchplate.com/update/dev/HASwitchPlate.ino.d1_mini.bin
Beta LCD firmware URL: http://haswitchplate.com/update/dev/HASwitchPlate.tft
HASP HA package
The packages have seen major changes, and that includes changing the names of some of the existing files and collapsing some files together. HASP v0.40 will not require updating your automations to work, but if you want the new automations Iām going to recommend completely replacing you existing packages due to the large number of changes incoming. This will wipe out any customizations you have made!
To update, run the following command and select āRā to replace your existing device packages:
bash <(wget -qO- -o /dev/null https://raw.githubusercontent.com/aderusha/HASwitchPlate/dev/Home_Assistant/deployhasp.sh)
āAlternativeā install users (venv
, hassbian
, etc) will want to sudo su -s /bin/bash homeassistant
first. Standard installs (`HassOSā, Docker, etc) can just run the script.
Next Steps
If you do give this beta a shot, let me know how it goes for you! The HASwitchPlate Discord chat will probably the best place to handle this so we can work through any problems interactively.
Much more betterer!
Looks fantastical!
In all seriousness though, I like what the icons add to the whole display.
They do look nice, although without trying it, I canāt say whether the text on the date might be a bit small.
Hey @luma, great job with this.
I have got it setup as described. I did have to search back through your notes to find the right font from a screenshot above but once i cracked that, it was all good.
A couple of questions if i can.
-
Would it also be possible to get a copy of the nexiton hmi file you used? Is there any instructions with regards to adding the new font in other sizes etc? I can not see the font to add.
-
I have setup the HA Lovelace with the suggested additons and this has show a new tab. However seeing your screenshots it appears you have a lot more options? Also i see references to adding buttons to the nexiton via HA or is this for a future development or is something missing as i suspect?
Thanks for your help and for this project. They have been great fun and look amazing.
Ross
Thanks!
For the moment youāll find those in the dev
branch of the project repo.
Thatās still just me playing with various options and demoing some of the features. When the deployhasp.sh
script is run a common set of devices are created which serve no purpose other than to demonstrate the features. For example, I create āfakeā lights, HVAC, alarm panel, and fan controller here. The end user would need to replace calls to these demo devices with controls for their own lights, and HVAC, and alarm panel, etc.
Most of what you see in those screenshots above is me adding the āfakeā device being controlled into the UI so that one can see whatās happening as I interact w/ the control being demonstrated.
Iām not 100% sure of the context of this one. The overall UI (the pages, the placement of control objects like buttons, etc) is done in the Nextion editor and flashed to the screen. At run time, Home Assistant automations interact with the controls flashed to the screen. Iāve included examples of both things (so, a Nextion HMI with a bunch of buttons and whatever along with HA automations which ādo thingsā with those controls), but you are free to go and edit either part as needed for your own use. However, the controls are ācookedā into the image and (for the most part) cannot be created or changed at run time.
Glad to hear it, itās been a really fun project for me and I continue to be surprised and delighted when other people find it interesting or useful.
Thanks @luma
Thats exactly what i was looking for as i can make minor tweaks in the hmi file.
The icons have really changed things for me as using the nexiton picc previously and it was becoming very complicated. This allows me to set some basic templates and select the icons wihtout the need of many different hmi files (i have 10 of these up around the house all with different rules, including brightness of the display which i never evn thought of previously.
Sorry having worked on this project over the past few months without the need to reach (good docs) i have always had little questions which have kind of been half answered before which i wanted to ask.
I know you have covered this before but do you think there is a simple way to add heating and thermostat support. I have a couple of places where i have i have them next to the devices on a second wemos but would like to save the hardware and run them in one unit.
This has got to be my favourite HA project to date and a project which keeps giving. I will let you know if i face any issues but on a quick test i have just done now, seems everything is working great.
Thank you so much again.
Ross
If youāve deployed the dev
release for v0.40, check out page 9 for HVAC controls. Is that what youāre after? Or are you talking about using the Wemos to directly control the HVAC system itself via relays or whatever?