HA SwitchPlate - DIY LCD Touchscreen wall switch replacement


#852

If you’re using the default weather.metno sensor bundled with previous versions, that was in fact hit by the latest breaking changes. The new component name is weather.met_no. You can either change the existing packages in place or re-run deployhasp.sh to grab the updated version with the new name for that component.


#853

.34 was suppose to fix it. It did not for me, maybe because I missed something. I just reloaded to factory settings but I changed the HASP node name (actually left it plate01) and re triggered first time setup. The down side is that I still had the old tabs called master. I have gotten rid of the one in the left side panel.


#854

its the one from your github, it is a bit tight for the lcd board but a little work with the knife and it works great, Great work by the way after watching dr zzzs video it was a doddle.

dont suppose you have the 3d printer page 9 yaml i cant figure how to add it as in my yamls i only have colour for page 9 not the config page?

any links to info/ how to do this? id like to use that page for temperature for the room

thanks once again once i sell some boards a drink will be heading your way :slight_smile: as buying 10x screens x 10 psu and 10 x wemos d1 and 100 boards im quite few ££ down lol


#855

I’m having a problem, at fairly regular intervals, I would say 3 hours, the plate becomes unavailable and the configuration screen appears on it with the qr code, all other devices connected to the same wifi have no problems, so I doubt it is a wifi problem. After a few minutes he reconnects and goes back to work without problems without my intervention.


#856

If the device drops WiFi connection, it will attempt to reconnect. If it cannot reconnect, it will go to the QR code configuration screen. If nothing happens after 5 minutes, it’ll reboot, starting the process over again.

This sounds like it has a marginal WiFi signal… If that’s the case it connects, eventually drops due to signal problems, it can’t reconnect so it reboots (maybe several times, each at 5min intervals while showing QR screen), and finally some time later is able to reconnect.

If you have several in the house, check the sensor attribute signalStrength of the problem unit vs the ones that are working. I’d suspect that what you’re experiencing is poor WiFi signal in the place you’ve installed that one unit. Metal workboxes are particularly problematic in this regard.


#857

@luma
Unfortunately I exclude a signal problem, because the device is open air, I’m still testing it, and a few centimeters from the access point


#858

got the 3d printer page working with room temps found the examples folder in config with the required yaml in thanks
# Automations to monitor a 3d printer on page 9
# This set of automations require the OctoPrint component to be configured against
# a running OctoPrint installation and will fail without it.
# https://home-assistant.io/components/octoprint/

#sensor:
#- platform: octoprint
#  name: OctoPrint
#  monitored_conditions:
#  - Current State
#  - Temperatures
#  - Job Percentage

#octoprint:
#  host: octoprint.local
#  api_key: YOUROCTOPRINTAPIKEY

automation:
   # Set appropriate font for the status display on HASP init
  - alias: hasp_livingroom_p9_3DPrinterInit
    trigger:
    - platform: state
      entity_id: 'binary_sensor.livingroom_connected'
      to: 'on'
    - platform: homeassistant
      event: start
    action:
    - service: mqtt.publish
      data:
        topic: 'hasp/livingroom/command/p[9].b[5].font'
        payload: '1'
   
  # Update status while printing
#  - alias: hasp_livingroom_p9_3DPrinterPrinting
#    trigger:
#    - platform: template
#      value_template: "{% if is_state('sensor.octoprint_current_state', 'Printing') %}true{% endif %}"
#    - platform: state
#      entity_id: sensor.octoprint_job_percentage    
#    condition:
#    - condition: state
#      entity_id: 'binary_sensor.livingroom_connected'
#      state: 'on'
#    action:
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].bco'
#        payload: '5285'
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].pco'
#        payload: '65535'
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].font'
#        payload: '1'
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].txt'
#        payload_template: '"Status:Printing\rProgress:{{(states.sensor.octoprint_job_percentage.state)|default(0)|round(1)}}%"'

  # Update status while printer is online but not printing
#  - alias: hasp_livingroom_p9_3DPrinterOperational
#    trigger:
#    - platform: template
#      value_template: "{% if is_state('sensor.octoprint_current_state', 'Operational') %}true{% endif %}"
#    condition:
#    - condition: state
#      entity_id: 'binary_sensor.livingroom_connected'
#      state: 'on'
#    action:
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].bco'
#        payload: '65535'
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].pco'
#        payload: '5285'
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].font'
#        payload: '2'
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].txt'
#        payload_template: '"Online"'
#  
  # Update status while printer is paused
#  - alias: hasp_livingroom_p9_3DPrinterPaused
#    trigger:
#      platform: template
#      value_template: "{% if is_state('sensor.octoprint_current_state', 'Paused') %}true{% endif %}"
#    condition:
#    - condition: state
#      entity_id: 'binary_sensor.livingroom_connected'
#      state: 'on'
#    action:
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].bco'
#        payload: '65535'
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].pco'
#        payload: '63488'
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].font'
#        payload: '2'
#    - service: mqtt.publish
#      data:
#        topic: 'hasp/livingroom/command/p[9].b[4].txt'
#        payload_template: '"Paused"'
  
  # Show the head and bed temps.  My locale is set for deg F, and I want deg C, so
  # the values are being converted in the template code
  - alias: hasp_livingroom_p9_3DPrinterTempText
    trigger:
    - platform: state
      entity_id: sensor.living_room_temperature_sensor
    - platform: state
      entity_id: sensor.dark_sky_temperature
    condition:
    - condition: state
      entity_id: 'binary_sensor.livingroom_connected'
      state: 'on'
    action:
    - service: mqtt.publish
      data:
        topic: 'hasp/livingroom/command/p[9].b[4].bco'
        payload: '5285'
    - service: mqtt.publish
      data:
        topic: 'hasp/livingroom/command/p[9].b[4].pco'
        payload: '65535'
    - service: mqtt.publish
      data:
        topic: 'hasp/livingroom/command/p[9].b[4].font'
        payload: '1'
    - service: mqtt.publish
      data:
        topic: 'hasp/livingroom/command/p[9].b[4].txt'
        payload: '"Temperature"'
    - service: mqtt.publish
      data:
        topic: 'hasp/livingroom/command/p[9].b[5].txt'
        payload_template: '"Indoor: {{((states.sensor.living_room_temperature_sensor.state))|round(1)}}\rOutside: {{((states.sensor.dark_sky_temperature.state))|round(1)}}"'
  
  # Every 30 seconds (default octoprint polling interval in Hass), add one pixel to the graph.
  # Don't bother sending data to the graph unless the page is active, waveform displays in Nextion
  # are always local, so the graph will reset every time you navigate away from the page.
  #     
  # The graph on page 9 has 4 divisions. We're calling the origin (y=0 in the graph) 50deg C and
  # the top line 250deg C.  Each pixel is one data point, the object on the page is 133 points tall.
  # my Location is using deg F, so convert from F to C then map 50-250 into a range of 1-133:
  # 50C = 122F, 250C = 482.  Thus the range of values in our chart will be 482-122 = 360 degF
  # 133/360 ~= 0.3694, so we can map our value in F to a 133-point-tall graph that goes from 50-250C
  # with the formula: (degF - 122) * 0.3694
  - alias: hasp_livingroom_p9_3DPrinterTempGraph
    trigger:
      platform: time
      seconds: '/1'
    condition:
    - condition: state
      entity_id: 'input_number.hasp_livingroom_activepage'
      state: '9.0'
    - condition: state
      entity_id: 'binary_sensor.livingroom_connected'
      state: 'on'
    action:
    - service: mqtt.publish
      data:
        topic: 'hasp/livingroom/command'
        payload_template: "add 6,0,{{((states.sensor.living_room_temperature_sensor.state))|int}}"
    - service: mqtt.publish
      data:
        topic: 'hasp/livingroom/command'
        payload_template: "add 6,1,{{((states.sensor.dark_sky_temperature.state))|int}}"

#859

All I can say is that, for one reason or another, it’s dropping the wifi connection and is unable to reconnect at reboot. Have you pulled the signalStrength values from the other devices vs this one?


#860

I have no other switchplates, but other devices with esp8266 show a worse signal and have never given me problems, the thing that I find strange is the regularity with which these disconnections occur.


#861

If it’s still on the bench, is it plugged in? Can you get a serial log from it?


#862

@luma
Yes, it is powered by the USB of the computer, and I can open a serial monitor


#863

Has anyone got a guide for using platformio.
I haven’t had much luck getting arduino to work on mac but I have done plenty of tasmota flashing with platformio


#864

HaSwitchPlate debug.yaml (103.8 KB)


#865

I’ve used esptool on mac to upload .bin


#866

Actually I went through a few utube guides on using arduino projects in platformio and now have it sorted.


#867

If you’re using platform.io (which I use to develop all of this, it’s great), make sure to include the following in your platformio.ini:

[env:d1_mini]
platform = [email protected]
board = d1_mini
framework = arduino
board_build.f_cpu = 160000000L
build_flags = -Wl,-Teagle.flash.4m1m.ld -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH

#868

Allright, this is helpful - thanks for grabbing the log @Superimo88! Here’s what I’m seeing:

First, about an hour and a half after start you lost connection to MQTT but didn’t lose WiFi: https://hastebin.com/vugecegohu.log
Next, about 4.5 hours after that, you drop WiFi. WiFi attempts to reconnect, fails, goes into autoconfig, then times out after 5 minutes, reboots itself, then is able to connect: https://hastebin.com/ikudiwohas.log

Here is what’s bugging me - both of these event occur immediately after publishing a status update, which just so happens to be the longest outgoing MQTT message we send. This feels like it can’t be a coincidence. I don’t know what exactly is happening in your case, but I’m going to add a few items to the debug log in the next version that maybe will help us get to the bottom of this.

Sorry I don’t have more for you at the moment, but this is a high priority for me and if you’ll stick with me here over the next version I’d like to continue troubleshooting the issue with you.

edit: one observation - that packet is assembled using a JSON library that I’m not exactly thrilled with, and probably doesn’t need to be. I’ve changed the code to manually create the JSON packet and to include some more information, which may resolve the issue, and if not, will at least give us a little more to go on.


#869

The first event, is the first time that it appears, while the disconnection from the wifi is constant every 3 hours, this morning I think it was postponed because of that first event due to problems with mqtt, because after that disconnection I had other at fairly regular intervals, I dont want to go wrong but I would say every 1 hour and 5 minutes or 1 hour and 35 minutes.
Of course I would be happy to try to solve this problem, even if for now it seems to have happened only to me it could be a problem that can affects other people in the future, or maybe someone who has never noticed it but who could have the same problem.


#870

Agreed, and I really appreciate you pointing it out and catching it in the act, this sort of bug reporting is super helpful.


#871

I am happy to be able to help you, you have done an incredible job both with this project and in making it primarily public and even more important accessible to evryone by simplifing it as much as possible