HA SwitchPlate HASPone: DIY In-Wall Touchscreen Home Assistant Controller

You will in fact need to restart hass to enable changes made to the configuration.yaml

Had to solve some more troubles that I could struggle by myself.
Now it is finally running. I still have lots to learn though.
Thanks a lot for helping me and taking your time.
Now the fun part begins


I have some more questions that I collected instead of question every now and then:

  1. Could not insert Âș symbol to temperature. I got ÂÂș instead. I assume it’s hard to do it, since otherwise it would be already done.

  2. Reload automations in HA results in all automations in PLATE01 panel to disappear. Will I have to restart all HA after every edit I made in plate automations? (if it is the case, that’s a good reason to implement automations in Node-Red, but it is not a simple task. At least for me).

  3. Clicking in the Nextion Simulator is supposely to behave as a real Nextion screen? I ask this because mine doesn’t reacts to any click (other than change “Simul Return”), even with some personal configurations, as my lights, media, as an example. I see that in “Simulator Return” in Nextion Simulator, hexadecimals change when I click on the screen. I have all automations (toggles) on except for the FirstTimeSetup.

  4. I’m trying to set the date to something like:

Tuesday
October 7

Tryed:
{{now().strftime('%A ') ~ now().strftime('%B ') ~ now().day}}

{{now().strftime('%A\n') ~ now().strftime('%B ') ~ now().day}}

But it doesn’t work. How I can achieve this?

  1. I would like to implement external and internal temperatures. Is it possible to include (in a small font) before each temperature something like “INT” and “EXT”?

Sorry for a bunch of questions. Hope it will be useful for other friends too. And thank you one more time!

I’m interested on the degree character. I’m not 100% sure the Nextion supports it. I remember looking into it and deciding it’s not worth the hassle so mine just says the temperature and F immediately after with no space.

I’ve got the automations set up in Node-RED. I never got it 100% finished to where I was totally happy with it, but right now most of the pages work fully. I had made great progress but had an SD card corruption wipe a ton of that out so I haven’t gone back to it since. Yeah the picture is small but there’s a handful of nodes there!

For example, here’s the set of flows that control the media player page (switched over to use Spotify)

Yep, easily. You just need to modify the string that is being sent to the panel (and the font size). This is handled in the automations. You can separate it across a couple of the buttons, or just shrink them together into the same line. If I have time this evening (though I don’t think I do), I’ll get into it and re-implement some of the features I used to have and take a couple of pictures. One of the big things I wanted was to change the way that the menu buttons at the bottom are handled so that all pages can be accessed instead of just three.

2 Likes

I filed this bug almost a year ago. I have no idea how to get Home Assistant to correctly send ° without it actually sending °.

This sadly is a result of using Home Assistant packages. They greatly simplify installation (particularly when running multiple HASP devices), but they have the side effect of not allowing reload of automations without restarting Home Assistant. If you’re comfortable with handling it, you can set this up without using packages by manually placing the contents of hasp_plate01_00_components.yaml into configuration.yaml and the remaining automations using configuration splitting.

Can you take a screenshot of what you’re seeing and/or some idea of how you’ve hooked up the in-circuit setup? If I had to guess at the moment it might be a problem with TX from the panel. Check out the instructions here for that.

Can you provide the entire automation config for this? I just checked this out and it worked on my test panel.

Possible but would require modification of the HMI using Nextion Editor. The approach used in the default file provided is to change the text labels on the buttons display. You can only have one font per button, but it would be possible to edit the HMI to place additional text boxes (or static text) wherever you want, which can have a separate font.

That’s great! As I expected, I knew it would be a hard task. Congratulations!
I would like at least to be able to read the nodes in your first picture. When you have some time, could you upload a new picture? Maybe divide it in 2 pictures
 Thanks for sharing.

About “INT” and “EXT” temperatures, please post if you have any success on this.

Can you take a screenshot of what you’re seeing and/or some idea of how you’ve hooked up the in-circuit setup?

There is not much to say.
D4 >>> Rx
D7 >>> Tx
Already checked, changed wires
 I don’t know, it should work.

Can you provide the entire automation config for this?

  - alias: hasp_plate01_p2_CalendarUpdate
    trigger:
      platform: time
      at: '00:00:00'
    condition:
    - condition: state
      entity_id: 'binary_sensor.plate01_connected'
      state: 'on'
    action:
    - service: mqtt.publish
      data:
        topic: 'hasp/plate01/command/p[2].b[5].font'
        payload_template: '{% set datelength = (now().strftime("%B ") ~ now().day)|length %}{% if datelength <= 6 -%}3{% elif (datelength > 6) and (datelength <= 10) %}2{% elif (datelength > 10) and (datelength <= 15) %}1{% else %}0{%- endif %}'
    - service: mqtt.publish
      data:
        topic: 'hasp/plate01/command/p[2].b[5].txt'
#        payload_template: "\"{{now().strftime('%B ') ~ now().day}}\""
        payload_template: "\"{{now().strftime('%A\n') ~ now().strftime('%B ') ~ now().day}}\""

I get:
sshot-1

And if use:
{{now().strftime('%A\n') ~ now().strftime('%B ') ~ now().day}}

I get “Wednesday August 8”, all in the same line and big font, so it doesn’t fit.

About the “INT” and “EXT” temperatures, user @ShadowDrake thinks it’s possible without dealing with HMI, so he may come with a solution.
Thanks for you patience.

Ahh you know what my bad, for a new line you’ll need to do something like this:
{{now().strftime('%A\\r') ~ now().strftime('%B ') ~ now().day}}

For the Nextion simulator, when you press a button do you see anything in “Simulator return”? Do you see anything on the serial console of the ESP8266?

In regards to the INT/EXT thing, one text field cannot have two different size fonts. You can either spread that across two buttons (such as on page 6) or modify the HMI to create an additional text field. I’m pretty confident on this one, on account of the fact that I designed and wrote it :smiley:

Using your code, now I got:
sshot-1

Yes, For every click on the screen I see changes in “Simulator return”. I cannot see the serial console of the ESP8266 since it’s is busy with Nextion Simulator.

About the INT/EXT thing, for sure you know what you are saying
 :smiley:

1 Like

You should still be able to see serial debug output on your NodeMCU. If you have it plugged into USB, open a serial console (Arduino IDE or whatever) and see if you get any debug out. The serial for Nextion is separate from debug serial and both should be available.

Yes I have it plugged in USB, and I have the following message in Arduino IDE:

Error opening serial pot “COM11”. (Port busy).

COM11 is the port used to connect to Nextion Simulator.

You should have no less than two serial ports. One that comes from the NodeMCU’s built-in USB serial UART which will be for debug, and then a second external USB UART that is used for the Nextion simulator.

Maybe jump on the Home Assistant Discord and we can walk through this in #diy

I’ll do you one better. Here’s a link to the Node RED flow as it stands now. It’s not feature complete, it’s a bit messy, there are a lot of comments and wishlist items. But it should be a great base if you’re a little familiar with Node RED. I tried to keep custom functions to an absolute minimum and just use built-in functions wherever possible. Most of the things done here could be done a lot easier with a custom function, yes
 but it would be more difficult for a new learner.

Import this into a new flow in your Node RED project. Before you do, do not forget to edit your HA server password near the end of the text (you can do this manually while it’s on the clipboard/with notepad). It takes up an entire flow page so make sure you paste it into a NEW flow.

image

Finally, before deploying these to Node RED disable ALL of the HASP automations. All functionality has been replicated here in this flow.

https://hastebin.com/akuxuhaboy.json

I’ll simulate multiple lines of text in a separate, shorter flow if you like so you can see what the differences are. The Node RED flows have a few less workarounds than the HA automations have to make it work :slight_smile:

3 Likes

Oh boy, the word’s out. I’m gonna find you on there now so I can hassle you in more real-time :grin:

1 Like

Thank you for sharing your work on this. My knowledge in nodered is very basic, but I’m sure it’s also a way to learn it.
Great plus for the project!

I took a look and definitely I could not do it myself.:confounded:
As I want to modify the original project, I think that I will have to take some time to understand the whole thing before I could give a try in node-red and with some hope adapt to my needs. Anyway it is something that I may try in the future. Probably I would implement piece by piece, removing automations step by step. It would be a way to understand it and learn. Thanks.

@michael.leone

hello, if you would still like to share stl file i am waiting to test them out

Many thanks

Gagan

Same thing that luma said, I’m available on discord at ShadowDrake#5865 if you’d like to message me directly there while you work through it. I personally find the Node RED flow a lot easier to wrap my head around as it’s more logical than the HA automations (and doesn’t use Jinja2 :face_vomiting:).

@luma side note, I tried adding the degree symbol through Node RED and still get an A with it. My Node RED installation is sending MQTT commands directly to HA’s built in Mosquitto broker so it’s either Mosquitto that’s the problem or maybe something with the Arduino sketch (seems unlikely), or the way the Nexion HMI is interpreting the input.

Thanks a lot. I may contact you in the future.

I can send commands using mosquitto_pub -t 'hasp/plate01/command/p[1].b[4].txt' -m '°' through my mosquitto broker and the panel displays the character correctly. This suggest to me that the mosquitto client, mosquitto broker, arduino sketch, and Nextion HMI are all able to handle this. You’ll find more detail in my bug report.