I created a input boolean and a button helper at same time. When I went into Alexa app and refreshed my device list, I only see the input boolean but not the button. Are buttons not available to be exposed to Alexa?
1 post - 1 participant
I created a input boolean and a button helper at same time. When I went into Alexa app and refreshed my device list, I only see the input boolean but not the button. Are buttons not available to be exposed to Alexa?
1 post - 1 participant
hello,
I’m trying to put together a voice assistant based on what JLo did in the Voice Assistant Contest Launch Video here: https://www.youtube.com/watch?v=99lGuB4J-4o&t=4912s, but I get no sound.
My home assistant is version 2024.2.1, running on an ethernet cable connected Pi 4.
I am running OPNSense, a managed switch, two access points and no crazy setup on my local LAN. no Vlans or anything special like that.
My yaml:
esphome:
name: virtual-assistant
friendly_name: Virtual Assistant
esp32:
board: esp32dev
framework:
type: esp-idf
esp_adf:
external_components:
- source: github://pr#5230
components:
- esp_adf
refresh: 0s
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
encryption:
key: "wkA+7LJ1XxlXA4KG/cc8hcvZQa0BZfvJwQC6SKassm8="
ota:
password: "902ba392051b3c21b93344a940631668"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Virtual-Assistant"
password: "ZVtsrQXRIjry"
captive_portal:
switch:
- platform: gpio
pin:
number: 22
mode: output
id: led
interval:
- interval: 300s
then:
- switch.toggle: led
i2s_audio:
- id: i2s_in
i2s_lrclk_pin: GPIO25 #ws blue
i2s_bclk_pin: GPIO19 # bclk green
# - id: i2s_out
# i2s_lrclk_pin: GPIO26 # Green
# i2s_bclk_pin: GPIO27 # blue
microphone:
- platform: i2s_audio
id: external_microphone
adc_type: external
i2s_din_pin: GPIO32
i2s_audio_id: i2s_in
pdm: false
bits_per_sample: 32bit
channel: right
speaker:
- platform: i2s_audio
id: external_speaker
dac_type: external
i2s_dout_pin: GPIO27
i2s_audio_id: i2s_in
mode: mono
voice_assistant:
id: va
microphone: external_microphone
speaker: external_speaker
use_wake_word: true
noise_suppression_level: 4
auto_gain: 31dBFS
volume_multiplier: 8.0
on_client_connected:
- voice_assistant.start_continuous:
I am using home assistant cloud. My IMNP441 Mic works, I get can turn on and off my test bulb, and the logs when I connect to my ESP32 tell me that I’m receiving a verbal response from the Cloud assistant, but I get nothing to my speakers. I can see that the logs turn the speakers on.
I have verified all of my connections, and I believe that my problem is not related to my setup. I am even able to verify that my Dout on the MAX98357A is going electrically high, when I get a response from the cloud. someone suggested to me I may have a UDP related problem. I’m looking for any thoughts or guidance.
a copy of my ESP32 log, after successfully turning on the test bulb:
INFO ESPHome 2023.12.9
INFO Reading configuration /config/esphome/virtual-assistant.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
INFO Starting log output from virtual-assistant.local using esphome API
INFO Successfully connected to virtual-assistant @ 192.168.1.154 in 0.163s
INFO Successful handshake with virtual-assistant @ 192.168.1.154 in 0.164s
[21:30:41][I][app:102]: ESPHome version 2023.12.9 compiled on Feb 15 2024, 20:18:49
[21:30:41][C][wifi:573]: WiFi:
[21:30:41][C][wifi:405]: Local MAC: 7C:9E:BD:06:62:8C
[21:30:41][C][wifi:410]: SSID: [redacted]
[21:30:41][C][wifi:411]: IP Address: 192.168.1.154
[21:30:41][C][wifi:413]: BSSID: [redacted]
[21:30:41][C][wifi:414]: Hostname: 'virtual-assistant'
[21:30:41][C][wifi:416]: Signal strength: -69 dB ▂▄▆█
[21:30:41][C][wifi:420]: Channel: 11
[21:30:41][C][wifi:421]: Subnet: 255.255.255.0
[21:30:41][C][wifi:422]: Gateway: 192.168.1.1
[21:30:41][C][wifi:423]: DNS1: 192.168.1.1
[21:30:41][C][wifi:424]: DNS2: 0.0.0.0
[21:30:41][C][logger:439]: Logger:
[21:30:41][C][logger:440]: Level: DEBUG
[21:30:41][C][logger:441]: Log Baud Rate: 115200
[21:30:41][C][logger:443]: Hardware UART: UART0
[21:30:41][C][switch.gpio:068]: GPIO Switch 'led'
[21:30:41][C][switch.gpio:091]: Restore Mode: always OFF
[21:30:41][C][switch.gpio:031]: Pin: GPIO22
[21:30:41][C][captive_portal:088]: Captive Portal:
[21:30:41][C][mdns:115]: mDNS:
[21:30:41][C][mdns:116]: Hostname: virtual-assistant
[21:30:41][C][ota:097]: Over-The-Air Updates:
[21:30:41][C][ota:098]: Address: virtual-assistant.local:3232
[21:30:41][C][ota:101]: Using Password.
[21:30:41][C][api:139]: API Server:
[21:30:41][C][api:140]: Address: virtual-assistant.local:6053
[21:30:41][C][api:142]: Using noise encryption: YES
[21:30:42][D][voice_assistant:519]: Event Type: 0
[21:30:42][D][voice_assistant:519]: Event Type: 2
[21:30:42][D][voice_assistant:609]: Assist Pipeline ended
[21:30:42][D][voice_assistant:412]: State changed from STREAMING_MICROPHONE to WAIT_FOR_VAD
[21:30:42][D][voice_assistant:418]: Desired state set to WAITING_FOR_VAD
[21:30:42][D][voice_assistant:170]: Waiting for speech...
[21:30:42][D][voice_assistant:412]: State changed from WAIT_FOR_VAD to WAITING_FOR_VAD
[21:30:42][D][voice_assistant:183]: VAD detected speech
[21:30:42][D][voice_assistant:412]: State changed from WAITING_FOR_VAD to START_PIPELINE
[21:30:42][D][voice_assistant:418]: Desired state set to STREAMING_MICROPHONE
[21:30:42][D][voice_assistant:200]: Requesting start...
[21:30:42][D][voice_assistant:412]: State changed from START_PIPELINE to STARTING_PIPELINE
[21:30:42][D][voice_assistant:433]: Client started, streaming microphone
[21:30:42][D][voice_assistant:412]: State changed from STARTING_PIPELINE to STREAMING_MICROPHONE
[21:30:42][D][voice_assistant:418]: Desired state set to STREAMING_MICROPHONE
[21:30:42][D][voice_assistant:519]: Event Type: 1
[21:30:42][D][voice_assistant:522]: Assist Pipeline running
[21:30:42][D][voice_assistant:519]: Event Type: 9
[21:30:44][D][voice_assistant:519]: Event Type: 10
[21:30:44][D][voice_assistant:528]: Wake word detected
[21:30:44][D][voice_assistant:519]: Event Type: 3
[21:30:44][D][voice_assistant:533]: STT started
[21:30:45][D][voice_assistant:519]: Event Type: 11
[21:30:45][D][voice_assistant:670]: Starting STT by VAD
[21:30:47][D][voice_assistant:519]: Event Type: 12
[21:30:47][D][voice_assistant:674]: STT by VAD end
[21:30:47][D][voice_assistant:412]: State changed from STREAMING_MICROPHONE to STOP_MICROPHONE
[21:30:47][D][voice_assistant:418]: Desired state set to AWAITING_RESPONSE
[21:30:47][D][voice_assistant:412]: State changed from STOP_MICROPHONE to STOPPING_MICROPHONE
[21:30:47][D][esp-idf:000]: I (4104329) I2S: DMA queue destroyed
[21:30:47][D][voice_assistant:412]: State changed from STOPPING_MICROPHONE to AWAITING_RESPONSE
[21:30:47][D][voice_assistant:519]: Event Type: 4
[21:30:47][D][voice_assistant:547]: Speech recognised as: "Turn on test bulb."
[21:30:47][D][voice_assistant:519]: Event Type: 5
[21:30:47][D][voice_assistant:552]: Intent started
[21:30:47][D][voice_assistant:519]: Event Type: 6
[21:30:47][D][voice_assistant:519]: Event Type: 7
[21:30:47][D][voice_assistant:575]: Response: "Turned on the light"
[21:30:47][D][voice_assistant:519]: Event Type: 8
[21:30:47][D][voice_assistant:595]: Response URL: "http://192.168.1.103:8123/api/tts_proxy/104c89b5f9053e4751d03002aab527c96124bd77_en-us_03ed9f9845_tts.home_assistant_cloud.wav"
[21:30:47][D][voice_assistant:412]: State changed from AWAITING_RESPONSE to STREAMING_RESPONSE
[21:30:47][D][voice_assistant:418]: Desired state set to STREAMING_RESPONSE
[21:30:47][D][esp-idf:000]: I (4104485) I2S: DMA Malloc info, datalen=blocksize=512, dma_buf_count=8
[21:30:47][D][i2s_audio.speaker:164]: Started I2S Audio Speaker
[21:30:49][D][voice_assistant:519]: Event Type: 99
[21:30:49][D][voice_assistant:665]: TTS stream end
[21:30:49][D][voice_assistant:283]: End of audio stream received
[21:30:49][D][voice_assistant:412]: State changed from STREAMING_RESPONSE to RESPONSE_FINISHED
[21:30:49][D][voice_assistant:418]: Desired state set to RESPONSE_FINISHED
[21:30:49][D][i2s_audio.speaker:167]: Stopping I2S Audio Speaker
[21:30:49][D][i2s_audio.speaker:178]: Stopped I2S Audio Speaker
[21:30:49][D][voice_assistant:315]: Speaker has finished outputting all audio
[21:30:49][D][voice_assistant:412]: State changed from RESPONSE_FINISHED to IDLE
[21:30:49][D][voice_assistant:418]: Desired state set to IDLE
[21:30:49][D][voice_assistant:412]: State changed from IDLE to START_MICROPHONE
[21:30:49][D][voice_assistant:418]: Desired state set to WAIT_FOR_VAD
[21:30:49][D][voice_assistant:153]: Starting Microphone
[21:30:49][D][voice_assistant:412]: State changed from START_MICROPHONE to STARTING_MICROPHONE
[21:30:49][D][esp-idf:000]: I (4106649) I2S: DMA Malloc info, datalen=blocksize=1024, dma_buf_count=4
1 post - 1 participant
Hi there,
I have some Dahua cameras and while all other functions work perfectly (e.g. streaming to frontend) I cannot get this function to work and would really appreciate some help from the community if possible.
I am trying a super simple service call from the Developer tools tab
The above example is me trying with camera installed as a generic camera rather than the Dahua integration but neither work. No file is ever written.
I have included /tmp in the configuration.yaml
homeassistant:
allowlist_external_dirs:
- “/tmp”
There is absolutely nothing coming up in logs at all related to when I hit the service call. The only thing that appears related to the cameras is this which pops up from time to time.
2024-02-16 13:06:00.441 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.12/site-packages/turbojpeg.py:901: UserWarning: Corrupt JPEG data: 608 extraneous bytes before marker 0xfe
I’m running HAOS on a proxmox VM all updated with latest versions but was having same issue on versions going back ~2/3 months.
Cameras are DH-IPC-HDW3849H-AS-PV-ANZ-BLK
All thoughts/help appreciated.
1 post - 1 participant
Hi,
I am attempting to setup several template sensors for air conditioner zones. There are 10 zones and I’d like to replicate10 sensors which are identical in structure but have information that is relevant to each zone. The entity/sensor has several attributes. The only thing that changes in each template definition is the zone name, which forms part of several of the entity names that the info is sourced from.
Is there a quick way of doing this?
I have looked at the macro function that is quite powerful, but from my experimentation is it can be used for a single data item i.e the state or attribute. What I’m looking at is defining a template for the whole entity (including attributes, icons, unique id etc.). Where I can pass the zone name as a parameter, say #zone, and it gets replaced through-out the syntax of the sensor config. Those of you familiar with C++ will know what I mean, but there is a pre-compiler step involved there.
Example config.
- name: "ac zone kitchen"
state: >
{% if (states('schedule.sleep_time')) %}
{% if (state_attr('climate.kitchen','current_temperature') | float >= state_attr('binary_sensor.ac_zone_sleep_time_temp_range_kitchen','upper') | float) %}
hot
{% elif (state_attr('climate.kitchen','current_temperature') | float <= state_attr('binary_sensor.ac_zone_sleep_time_temp_range_kitchen','lower') | float) %}
cold
{% else %}
normal
{% endif %}
{% else %}
{% if (state_attr('climate.kitchen','current_temperature') | float >= state_attr('binary_sensor.ac_zone_awake_time_temp_range_kitchen','upper') | float) %}
hot
{% elif (state_attr('climate.kitchen','current_temperature') | float <= state_attr('binary_sensor.ac_zone_awake_time_temp_range_kitchen','lower') | float) %}
cold
{% else %}
normal
{% endif %}
{% endif %}
icon: mdi:google-classroom
attributes:
current_temperature: >
{{ state_attr('climate.kitchen','current_temperature') | float }}
awake_time_temp_range_lower: >
{{ states.binary_sensor.ac_zone_awake_time_temp_range_kitchen.attributes.lower }}
awake_time_temp_range_upper: >
{{ states.binary_sensor.ac_zone_awake_time_temp_range_kitchen.attributes.upper }}
sleep_time_temp_range_lower: >
{{ states.binary_sensor.ac_zone_sleep_time_temp_range_kitchen.attributes.lower }}
sleep_time_temp_range_upper: >
{{ states.binary_sensor.ac_zone_sleep_time_temp_range_kitchen.attributes.upper }}
- name: "ac zone living"
state: >
{% if (states('schedule.sleep_time')) %}
{% if (state_attr('climate.living','current_temperature') | float >= state_attr('binary_sensor.ac_zone_sleep_time_temp_range_living','upper') | float) %}
hot
{% elif (state_attr('climate.living','current_temperature') | float <= state_attr('binary_sensor.ac_zone_sleep_time_temp_range_living','lower') | float) %}
cold
{% else %}
normal
{% endif %}
{% else %}
{% if (state_attr('climate.living','current_temperature') | float >= state_attr('binary_sensor.ac_zone_awake_time_temp_range_living','upper') | float) %}
hot
{% elif (state_attr('climate.living','current_temperature') | float <= state_attr('binary_sensor.ac_zone_awake_time_temp_range_living','lower') | float) %}
cold
{% else %}
normal
{% endif %}
{% endif %}
icon: mdi:google-classroom
attributes:
current_temperature: >
{{ state_attr('climate.living','current_temperature') | float }}
awake_time_temp_range_lower: >
{{ states.binary_sensor.ac_zone_awake_time_temp_range_living.attributes.lower }}
awake_time_temp_range_upper: >
{{ states.binary_sensor.ac_zone_awake_time_temp_range_living.attributes.upper }}
sleep_time_temp_range_lower: >
{{ states.binary_sensor.ac_zone_sleep_time_temp_range_living.attributes.lower }}
sleep_time_temp_range_upper: >
{{ states.binary_sensor.ac_zone_sleep_time_temp_range_living.attributes.upper }}
This is an example of two (of 10) zones - “kitchen” and “living”
I was able to use a macro for the “state”, which is quite handy as it is the most complex part. But would be great if I could replace text or even entities, for the whole template rather than each data item. This would make future maintenance easier as well.
I am a “tinkerer/hobbyist”. Any assistance on this is much appreciated - thanks in advance.
4 posts - 3 participants
Hi! I have used several evenings to try getting this solved… i am trying to display attributes/data from a sensor that has multiple similar attributes. My goal is to fetch petrol price for each - id: , and fueltypeid, but i am not getting anywhere with templates (not good at it). Either it is to split them in separate sensors by - id: (petrol stations identity) or a card that can display the selected items.
Here is both a screenshot of the output, and partly output as text from the command line sensor:
Everything that points me in the right direction is highly appreciated!
//
1 post - 1 participant
Hi,
Curious if anyone here has the same experience.
Initially I was using the Skyconnect in multiprotocol mode which now and then gave zigbee warnings and errors but all my 24 zigbee devices reported LQI 255 with RSI values around -60 - - 75. I’m using channel 20 with extension cable for the skyconnect.
3 days ago I decided to disable the multiprotocol mode on the skyconnect and upto now no zigbee warnings or errors are reported but the strange thing is that LQI values are now in range of 152-205 instead of stable 255 and the RSi values are around -40 - -55 which seems to be improved a bit.
Is this normal, that the LQI values seems little bit less and RSI value seems to improve a bit when disabling the multiprotocol mode on Skyconnect?
As I don’t have yet threat devices I will keep multiprotocol disabled as the system seems more stable now.
1 post - 1 participant
Hello, I am looking for a card (Mushroom ?) which allows me to display a number of missed calls, and :
So I would need 1 button, 2 buttons would be the best
any advise ?
Many Thanks !
1 post - 1 participant
Hello all,
I cannot seem to be getting my automation to work. Any help would be appreciated.
The context:
I want a sensor to be updated every minute, but ONLY when a switch is ON (and after 3 minutes of it being switched on). For those who are curious, I have a temperature probe within a swimming pool pipe and want an accurate reading on the temperature, i.e. only when the filtration is on.
I don’t want continuous updates, only every minutes, sadly my “while” condition is failing so far :
{The notifications are used as a test : my phone is getting spammed like crazy]
alias: Pool Temperature
description: Determines the pool temperature once filtration is ON.
trigger:
- platform: device
type: turned_on
device_id: 6fd153ce7bda119b15030483841a7b77
entity_id: a7c4800a3935b6c2ef5a73e73815f6ad
domain: switch
for:
hours: 0
minutes: 3
seconds: 0
condition: []
action:
- repeat:
while:
- condition: device
type: is_on
device_id: 6fd153ce7bda119b15030483841a7b77
entity_id: d7d1a58545a128d23cbe2f0d1694f1d1
domain: switch
for:
hours: 0
minutes: 0
seconds: 30
sequence:
# for:
# hours: 0
# minutes: 0
# seconds: 30
- service: notify.mobile_app_phone
data:
message: Pool Temperature is at
- service: input_number.set_value
metadata: {}
data:
value: "{{ states('sensor.pool_air_temperature') | float}}"
target:
entity_id: input_number.pool_temperature
enabled: true
mode: single
Latest attempt is commented out and has failed miserably, YAML won’t take it.
Any help much appreciated!
Many thanks
1 post - 1 participant
I’m having a strange issue with Emulated Hue. All of a sudden, the lights that are triggered by the RFXCOMM integration are unresponsive - while other integrations seem to keep their connection fine.
Looking at : http://homeassistant.local/api/v2/lights, all the configuration seems correct and when deleting the unresponsive lights (all RFXCOMM), and re-discovering on Alexa, the lights are found again, but then after a time, become unresponsive. This has only just started to happen.
In my configuration file, an entry would look like this:
light.lightwaverf_siemens_020003_1:
name: “Main Bedroom Light”
hidden: false
As mentioned, it worked fine up until yesterday…
1 post - 1 participant
I am currently running Z-Wave JS UI under Docker, which is connected to Z-Wave JS integration on my HAOS server with WS.
What’s the best approach to move the Docker instance over to the HAOS server, keeping the Z-Wave JS UI features?
Thanks!
1 post - 1 participant
Hi
Have a thermostat from Futurehome that I can include via Conbee II USB adapter to HA.
But I never get any entities. I have other thermostats that works well, but not this one.
I see that HA recognize the unit at SMART-PLUG and not THERMOSTAT.
Can this be the case?
2 posts - 2 participants
I have an issue with an automation that turns red/not available after I update HA - Issue. I can fix this by duplicating or editing the automation. So my idea is to change the description or alias after HA starts.
Is this possible to automate?
5 posts - 2 participants
Hi
I’m newbie to HA and YAML.
I got this automation and it’s working.
alias: Ikea Light button
description: “”
trigger:
I have made a helper var called “Kelvin stue” and Entity ID: input_number.colortone
I wat tow things:
I have tried sevarel things, but not succeded yet.
My light bulb is a Ikea LED1732G11
Thanks in advance
Bjarne
2 posts - 2 participants
First, the good news: I managed to install ebusd addon and the adapter so that I can see all of the entities sent from my Vaillant gas boiler (and there are a lot!)
However, I need to dynamically change one of these (FlowTempDesired) according to what the boiler is heating. Having read a lot of posts, it seems that ebusd is read only by default so I have added “–mqttvar=filter-direction=r|u|^w,filter-name=” as a Custom Command Line Option in the ebusd addon configuration tab.
I can see from MQTT Explorer that the correct message is being sent to MQTT but it never arrives at the boiler, or the boiler is ignoring it.
Have people manage to control the boiler parameters through MQTT? Is there something I’m missing? Or do Vaillant boilers not accept external ebus messages?
Thanks for any help
1 post - 1 participant
I’m new to Home Assistant/ymal so please be patient with me. I have a floor plan dashboard that uses state_image to overlay images of the lit rooms when those lights are on. I recently installed browser_mod to open a popup window of my security camera feed when I tap the camera on my floorplan. It works perfectly, but I’m trying to use state_image and an input Boolean to overlay an image on the floorplan when the popup service is called. Is it possible to toggle a Boolean inside of the service? I’ve read that scripts can be used, but it’s my understanding that the browser_mod popup service cannot be called within a script. (I’ve tried and it doesn’t work)
Here is the yaml for the popup:
- type: state-icon
entity: camera.192_168_xxx_xxx
icon: mdi:battery
tap_action:
action: call-service
service: browser_mod.popup
target:
device_id:
- dca871f7fdf91fa857bfc99d535bdae0
data:
dismissable: true
autoclose: false
title: Driveway Camera 1
content:
show_state: false
show_name: false
camera_view: live
type: picture-entity
entity: camera.192_168_xxx_xxx
style:
top: 54%
left: 8%
rotate: '-51deg'
opacity: 0.1
'--mdc-icon-size': 65px
'--paper-item-icon-color': white
This code overlays the image based on the Boolean input state:
- type: image
entity: input_boolean.driveway_camera_1_toggle
style:
top: 50%
left: 50%
width: 100%
pointer-events: none
tap_action: none
hold_action: none
z-index: 1
state_image:
'on': \local\camera_driveway1_on.png
'off': \local\transparent.png
My endgame is for the camera on the floorplan to show a little red light when the popup service is called and active:
1 post - 1 participant
Hi, my HA developed problems a while ago where YAML configuration files for ESPHome disappeared. The system kept working so I ignored it at 1st. But one by one my mains switches in HA stopped working and my Sonoff basic units, which control my radiators, also started misbehaving.
So I created new YAML files for my Sonoff. The 1st Sonoff integrated fine in HA, so I continued the same process: 1 remove the device from HA, 2 write the new YAML file to it, test it updates wirelessly in ESPHome. The yaml file and nodes have new names (climate dining room).
The latest Sonoff was not detected by HA however, and the old device (CH switch 4 dining room) is still listed under devices. I have rebooted HA several times.
How do you remove the old device and force HA to adopt the new configured/programmed Sonoff basic?
I read some posts about 3 options with the 3rd being a dreaded registry/hidden file edit/ensure you’ve got a back up
1 post - 1 participant
Having a strange problem from last few days, the Alexa Media Player Stopped playing custom Mp3 via TTS, I believe it’s been broken since a month or so, however I noticed it yesterday.
Here is the script
service: notify.alexa_media
data:
message: "<audio src='https://oxxxxxxxxx.ui.nabu.casa/local/mp3/notification/garage-motion.mp3'/>"
title: Motion in Garage.
target: media_player.front_guest_room_echo
data:
type: tts
The error says : Sorry I am having trouble accessing your Simon Says Skill
Any thoughts or helps will be really appreciated.
Another Point - it works as expected if I pass a text. however no luck with MP3, I tried announce mode as well, however no luck
1 post - 1 participant
Hi guru’s!
A newbie here; using HA for a few weeks, in Docker.
I am still trying to get myself comfortable with HA, browsing&playing around, but still unable to get some basic thing to work.
There are some topics with similar things in subject, but those seem to be about a different problem.
I have multiple Tasmota-based devices that are running tasmota rules to perform specific tasks, like thermostat in this case.
Tasmota devices themselves were successfully discovered by HA automatically, but I want to get the information that is published when rules execute.
Normally, Tasmota’s STATE topics are used to obtain this info, but I had to suppress them to once-per-minute to save the bandwidth.
So, when rules execute, they publish many multiple things under RESULT topic:
$ grep pow1 /var/log/mosquitto/traffic.log | grep RESULT
stat/tasmo/tasmopow1/RESULT {"Var2":"-8"}
stat/tasmo/tasmopow1/RESULT {"Add2":"-7.000"}
stat/tasmo/tasmopow1/RESULT {"Mem1":"16"}
stat/tasmo/tasmopow1/RESULT {"Var1":"4.1"}
stat/tasmo/tasmopow1/RESULT {"Mem1":"16"}
stat/tasmo/tasmopow1/RESULT {"Event":"Done"}
stat/tasmo/tasmopow1/RESULT {"POWER1":"1"}
stat/tasmo/tasmopow1/RESULT {"POWER1":"0"}
stat/tasmo/tasmopow1/RESULT {"Var2":"16"}
stat/tasmo/tasmopow1/RESULT {"Add2":"17.000"}
stat/tasmo/tasmopow1/RESULT {"Var1":"4.2"}
stat/tasmo/tasmopow1/RESULT {"Mem1":"16"}
stat/tasmo/tasmopow1/RESULT {"Event":"Done"}
stat/tasmo/tasmopow1/RESULT {"POWER1":"1"}
stat/tasmo/tasmopow1/RESULT {"Var2":"16"}
stat/tasmo/tasmopow1/RESULT {"Add2":"17.000"}
stat/tasmo/tasmopow1/RESULT {"Var1":"4.1"}
stat/tasmo/tasmopow1/RESULT {"Mem1":"16"}
stat/tasmo/tasmopow1/RESULT {"Event":"Done"}
stat/tasmo/tasmopow1/RESULT {"POWER1":"1"}
stat/tasmo/tasmopow1/RESULT {"Var2":"16"}
stat/tasmo/tasmopow1/RESULT {"Add2":"17.000"}
stat/tasmo/tasmopow1/RESULT {"Var1":"4.2"}
stat/tasmo/tasmopow1/RESULT {"Mem1":"16"}
stat/tasmo/tasmopow1/RESULT {"Event":"Done"}
stat/tasmo/tasmopow1/RESULT {"POWER1":"1"}
I want to capture specific things:
stat/tasmo/tasmopow1/RESULT {"Mem1":"16"}
stat/tasmo/tasmopow1/RESULT {"POWER1":"1"}
mqtt:
- sensor:
- name: test tasmopow1 power1
unique_id: tasmopow1_power1
state_topic: stat/tasmo/tasmopow1/RESULT
# value_template: "{{ value_json['POWER1'] }}"
value_template: "{{ value_json.POWER1 }}"
- sensor:
- name: test tasmopow1 mem1
unique_id: tasmopow1_mem1
state_topic: stat/tasmo/tasmopow1/RESULT
# value_template: "{{ value_json['POWER1'] }}"
value_template: "{{ value_json.Mem1 }}"
Normal mqtt sensors do capture them, but since multiple kinds of variables are reported under the same topic, captured state is lost when next RESULT contains different data in it, and a warning is logged.
2024-02-16 16:00:32.204 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'POWER1' when rendering '{{ value_json.POWER1 }}'
2024-02-16 16:00:32.205 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'Mem1' when rendering '{{ value_json.Mem1 }}'
I think I noticed once a recommendation how to deal with this, using template trigger and sensor, but I can not find that anymore.
I tried that approach, but did not see any change to behaviour:
template:
- trigger:
- platform: mqtt
topic: stat/tasmo/tasmopow1/RESULT
payload: "True"
value_template: "{{ value_json.Mem1 }}"
sensor:
- unique_id: test_tmpl_mem1
name: "test tmpl Mem1"
state: >-
{{ trigger.payload_json.Mem1 }}
It’s not quite clear how was this supposed to work, or how was i supposed to see it’s results.
Is there a document somewhere, that would describe things like value_json, trigger.payload_json? What other options are there? I see value_json is giving me dictionary’s value, is there a way to obtain it’s key? How can I check if a dictionary contains particular key, without causing a warning?
Obviously I do not have enough understanding of basic concepts; I would be happy if somebody helped me out, directing me to docs/examples/whatever on this.
KPL
1 post - 1 participant
Hello people. I’m trying to automate my AC to turn on if my room gets too hot. I’ve also set a boolean helper where I could tell it that I don’t want it to handle the cooling automatically. My problem is if the room is already above the temperatures I’ve set before I’ve told it to handle cooling automatically, will the triggers not work anymore since they do not cross the temperature threshold? Is there any way to fix this? Thanks in advance.
alias: Turn AC on if room is too hot
description: ""
trigger:
- platform: numeric_state
entity_id:
- sensor.none_indoor_temperature
for:
hours: 1
minutes: 0
seconds: 0
above: 29
id: room_above_29
- platform: numeric_state
entity_id:
- sensor.none_indoor_temperature
above: 32
id: room_at_32
for:
hours: 0
minutes: 0
seconds: 0
- platform: numeric_state
entity_id:
- sensor.none_outdoor_temperature
for:
hours: 2
minutes: 0
seconds: 0
above: 32
id: outdoor_above_32
condition:
- condition: device
device_id: 58e1854de54ed1c84a0d36e415595ffe
domain: device_tracker
entity_id: 8b04318a81843cd1c1a28ed7f404a9b7
type: is_home
- condition: state
entity_id: climate.midea_ac_147334558192167
state: "off"
- condition: time
after: "06:00:00"
before: "01:00:00"
- condition: state
entity_id: input_boolean.allow_cooling_automatically
state: "on"
action:
- service: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: cool
target:
entity_id: climate.midea_ac_147334558192167
- service: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.ac_turned_on_automatically
- if:
- condition: trigger
id:
- room_at_30
then:
- parallel:
- device_id: 58e1854de54ed1c84a0d36e415595ffe
domain: mobile_app
type: notify
message: Room temperature above 30°C
title: Turned AC on
- device_id: 2093dfc937731c28924695ec5ace0132
domain: mobile_app
type: notify
message: Room temperature above 30°C
title: Turned AC on
else:
- if:
- condition: trigger
id:
- outdoor_above_32
then:
- parallel:
- device_id: 58e1854de54ed1c84a0d36e415595ffe
domain: mobile_app
type: notify
message: Outdoor temperature above 32°C
title: Turned AC on
- device_id: 2093dfc937731c28924695ec5ace0132
domain: mobile_app
type: notify
message: Outdoor temperature above 32°C
title: Turned AC on
else:
- parallel:
- device_id: 58e1854de54ed1c84a0d36e415595ffe
domain: mobile_app
type: notify
message: Room temperature too hot
title: Turned AC on
- device_id: 2093dfc937731c28924695ec5ace0132
domain: mobile_app
type: notify
message: Room temperature too hot
title: Turned AC on
alias: Notify device with what triggered
mode: single
3 posts - 3 participants
I had an old install of Home Assistant that I hadn’t updated for two years. Rather than try to update it and fix everything that got broken, I decided to just start fresh.
I have everything working and I’m trying to try espresense, but the example code for the sensors doesn’t work for my config. In my previous installation, my config had things like sensor, switch, light, etc blocks, but the new install ended up with a mqtt block that all of those were under, which I believe I based on this: MQTT Switch - Home Assistant
Did I do something wrong here?
Here’s a small snippet showing one switch and one sensor
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
group:
family:
name: Family
icon: mdi:home-heart
entities:
- person.steve
- person.becky
- person.nate
mqtt:
- switch:
name: "Front Porch"
unique_id: Front_Porch_switch
icon: mdi:ceiling-light
command_topic: "cmnd/SonoffFrontPorch/power"
state_topic: "stat/SonoffFrontPorch/RESULT"
value_template: "{{value_json.POWER}}"
qos: 1
state_on: "ON"
state_off: "OFF"
payload_on: "ON"
payload_off: "OFF"
retain: false
- sensor:
name: "Dryer State"
state_topic: "hass/state/dryer"
icon: mdi:tumble-dryer
Thanks!
1 post - 1 participant