@jobraun is the bloody best !
Works perfectly - thank you so much !!
Yâall going to need this today after the Appdaemon update âŠ
Hi All,
Before all the recent changes I would use a include statement that looked like
!include /config/appdaemon/apps/nsp-masterss.yaml.
This for obvious reasons no longer works.
Unfortunately I have tried a few comboâs (randomly) i.e.
!include /addon_configs/a0d7b954_appdaemon/apps/nsp-masterss.yaml
Can somebody point me in the correct direction to using includes correctly in the new world.
Thanks Heaps
edit: i seem to be blind and/or dumb, since Blakadder had already updated their documentâŠ
Found it some time later had to uart the Nextion, but here it is for those still rocking the stock:
- platform: template
name: Wallpaper
id: ${device_name}_wallpaper
icon: mdi:cat # mdi:wallpaper
entity_category: config
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
turn_on_action: # âÂșUâąĂĄ.."HMI_wallpaper":1m2UâąĂ'. 0x87 135 {"HMI_wallpaper":1}
lambda: |-
id(ns_panel).send_json_command(0x87, "{\"HMI_wallpaper\":1}");
turn_off_action:
lambda: |-
id(ns_panel).send_json_command(0x87, "{\"HMI_wallpaper\":0}");
Can microphone be used by esphome firmware? I have searched a lot but have not found a single mention of GPIO where microphone is connected, other than it has microphone (in marketing materials)
Sounds like you are confusing the original âSonoff NSPanelâ which this thread is about with the âSonoff NSPanel Proâ(?), as the former that is based on an Esspressif ESP32 does not have a built-in microphone but the latter that is based on Android OS does, (note that they are not based on the same platform components at all, as you might understand).
Or do you mean you soldering your own microphone to the original âSonoff NSPanelâ (which this thread is about)?
Anyway, the ESPHome does support Microphone Components if the hardware is already connected, see â Microphone Components â ESPHome
For a ESP32 development kit hardware with built-in microphone (and speaker) check out Espressif ESP32-S3-BOX-3 and the M5Stack Atom Echo.
ESP Home and ESP32 S3 Box? or for better hardware the Onju Voice (Google Nest Mini speaker replacement PCB with ESP32-S3):
thanks. According to the description, NSpanel (not PRO version) does have microphone:
https://itead.cc/product/sonoff-nspanel-smart-scene-wall-switch/
ăMultiple Ways to ControlăYou can use the dual-channel switches, touchscreen, and eWeLink App to control SONOFF NSPanel; Besides, SONOFF NSPanel supports Alexa , Alice , Google Assistant , and even Siri Shortcuts , you can control your home appliances with simple voice control.
ah, I see now how they mean it. So it does not have microphone indeed. Sad.
The original original âSonoff NSPanelâ does not have a built-in microphone, and its description only mentions that it can be integrated (over a WiFi network) and controlled by third-party smart home ecosystems like Alexa (e.i. Amazon Echo smart speakers/displays) and Google Assistant (e.i. Google Home/Nest smart speakers/displays).
Hi Blackadder. Sorry I am very inexperiences, but do you have a photo or info on what pins to connect to 5V for the spaniel pro please?
This is used in the Esphome code for a Sonoff NS Panel, using Esphome 2023-11-6.
number:
# Screen brightness
- platform: template
name: Brightness
id: brightness
entity_category: config
unit_of_measurement: '%'
min_value: 0
max_value: 100
step: 1
initial_value: 30
set_action:
then:
- lambda: 'id(disp1).set_backlight_brightness(x/100);'
- lambda: 'id(disp1).send_command_printf("Home.brightness.val=%i", int(x));'
- lambda: 'id(disp1).send_command_printf("Settings.n0.val=%i", int(x));'
- lambda: 'id(disp1).send_command_printf("Settings.bright.val=%i", int(x));'
It creates a âBrightnessâ slider control in Home Assistant that has an initial value of 30. When itâs moved, the control shows the value it is moved to and it sends that value to the NS Panel using the set_action: lines. This is all working correctly.
Using the touch screen on the NS Panel you can also set the screen brightness using a âScreen Brightnessâ slider control. I have managed to get the âBrightnessâ slider in Home Assistant to move the NS Panel âScreen Brightnessâ slider position and itâs value to match the Home Assistant âBrightnessâ position and value so they stay in sync.
What I have been unable to do after nearly 3 days of searching, reading and trying different methods is to make the âBrightnessâ control in Home Assistant change position and value to match the NS Panel âScreen Brightnessâ slider when that is moved. I donât think the problem Iâm having is just because itâs a Sonoff NS Panel Iâm using it with. I think Iâm just not using the correct method to do it, but I could be wrong.
Has anyone any suggestions on what Iâm doing wrong and how to achieve this?
Typically after posting my question a couple of hours later I found an alternative way to do it!
In Home Assistant I created a helper input_number.test_slider. Then created an automation that is triggered when the input_number.test_slider is moved which sets the NS Panel Screen Brightness slider to the same value
alias: Test Slider NS Panel Brightness Change
description: Test Slider Changes NS Panel Screen Brightness
trigger:
- platform: state
entity_id:
- input_number.test_slider
from: null
condition: []
action:
- service: number.set_value
target:
entity_id: number.nspanel_brightness
data:
value: |
{{ states('input_number.test_slider')|int(0) }}
mode: singletype or paste code here
I created a second automation that is triggered by the NS Panel lightslider being moved which sets the input_number.test_slider to the same value
alias: NS Panel Brightness Change
description: NS Panel Screen Brightness Changes Test Slider
trigger:
- platform: state
entity_id:
- sensor.nspanel_lightslider
from: null
condition: []
action:
- service: input_number.set_value
target:
entity_id: input_number.test_slider
data:
value: |
{{ states('sensor.nspanel_lightslider')|int(0) }}
mode: singletype or paste code here
I tried to use number.nspanel.brightness as the trigger entity_id and for the value in the second automation but it didnât work. So I had to create a new sensor in the Esphome code
sensor:
# Gets the value of the Screen Brightness into HA
# Uses On Release code in the Nextion Screen Brightness slider for it to work.
- platform: nextion
id: lightslider
name: lightslider
variable_name: lightslidertype or paste code here
In the Nextion Editor add this code to the Touch Release Event for the Screen Brightness slider to pass the brightness value to Home Assistant via the lightslider sensor
printh 91
prints "lightslider",0
printh 00
prints n0.val,0
printh FF FF FF
Moving either slider now changes the screen brightness and the other sliders value and position so they stay in sync.
The only remaining issue is that the lightslider sensor shows as âUnknownâ in Home Assistant until the Screen Brightness slider is moved. Trying to check for âUnknownâ using isnan doesnât work and I havenât been able to find a way that does work.
sensor:
# Gets the value of the Screen Brightness into HA
# Uses On Release code in the Nextion Screen Brightness slider for it to work.
- platform: nextion
id: lightslider
name: lightslider
variable_name: lightslider
filters:
- lambda: !lambda |-
if (isnan(x)) return 30;
return x;
Hopefully other people will find this useful.
Anyone here ever succeeded in using PSRAM from NSPanel?
Been using GitHub - joBr99/nspanel-lovelace-ui: Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota. for quite a long time succesfully. Now the panel is not responding to touch much at all.
Is there a way to boot the system? (other than removing house fusesâŠ)
Have you tried the reset button in the bottom of the panel?
Thanks! Totally forgot that thereâs a reset button. Pressing that didnât help, just resulted in âWaiting for contentâ screen.
The Tasmota gui is working and thereâs a reset option, also: same thing.
Somehow HA has lost the device totally.
EDIT: Updated HACS, AppDaemon, restarted HA⊠at least. Now NSPanel entities are seen by the HA again. Just the panel GUI is still missing.
Now it seems that the AppDaemon stops working.
EDIT2: AppDaemon secrets.yaml location needed an update, this solved it AppDaemon won't start - complains about secrets.yaml - #21 by p-x
I was thinking of something like this so really glad to hear youâve got it working. Could you give more detail of what you did, Iâd really like to do the same. E.g. some photos of the implementation, which sensor etc? It would be much appreciated.
Does anyone know if its possible to enable a âbutton releasedâ command?
I am using @jobraun Lovelace UI with Tasmota, my buttons are decoupled from the relays and all working fine but id like to use a long press to Dim & Brighten some lights - without the button released command i just end up in a continuous loop, Any ideas?
Hi @jobraun
Thanks for giving my home so much joy with your NSpanel code !
Iâm having an issue with the latest update 2024.04. Iâve followed creating the scripts as suggested on
However, I get this on my screen for the forecast dates
Hereâs my scripts:
template:
- trigger:
- platform: time_pattern
hours: /1
action:
- service: weather.get_forecasts
data:
type: daily
target:
entity_id: weather.home
response_variable: daily
sensor:
- name: Weather Forecast Daily
unique_id: weather_forecast_daily
state: "{{states('weather.home')}}"
attributes:
temperature: "{{state_attr('weather.home', 'temperature')}}"
temperature_unit: "{{state_attr('weather.home', 'temperature_unit')}}"
forecast: "{{daily['weather.home'].forecast}}"
and here is the other bit
entities:
- entity: weather.home
- entity: sensor.weather_forecast_daily
type: 0
- entity: sensor.weather_forecast_daily
type: 1
- entity: sensor.weather_forecast_daily
type: 2
- entity: sensor.weather_forecast_daily
type: 3
- entity: sensor.ingham_imported_energy_cost
name: $ Today
icon: mdi:solar-power-variant
Any guidance on what I may need to change ?
All the best
Jason
Hi Jason,
Can I ask if your in Australia and using the BOM integration. As I have the same issue as yourself.