Quantcast
Channel: Configuration - Home Assistant Community
Viewing all 107201 articles
Browse latest View live

Voice assistant respond by play wav file

$
0
0

Is it possible to have voice assistant answer a question by playing a .wav file?

I assume I will have to create an automation that triggers when a specific question is said, then the action be play the wav file. I don’t know if it’s possible to play the wave file or if the “Set conversation response” action only takes text input

Has anyone done that before or have any ideas?

1 post - 1 participant

Read full topic


Changing Channels on Android TV Remote

$
0
0

Trying to read and understand this documentation on Android TV Remote and I tried out the example code below and modified it for my device but I can’t get it to work in both scripts nor dev tools. Any insight on what I might be missing here would be great.

action: media_player.epico_box_4
data:
  media_content_type: channel
  media_content_id: 105
target:
  entity_id: media_player.epico_box_4

My intention is to write this into a script to execute upon button push on a Universal TV Remote Card.

1 post - 1 participant

Read full topic

Help with launching app in Fire TV via script

$
0
0

I’m trying to recreate a button from the Firemote card example below but on the Universal TV Remote instead. I have added the Fire TV in the example via Android Debug Bridge as I was not able to connect via Android TV Remote as for some reason the IP address of the Host kept failing to connect. But I digress.

When I try to run the script on the left using Android TV Remote commands, I get the following error.
Entity media_player.fire_tv_192_168_0_57 does not support action media_player.play_media.
I believe this kind of makes sense since I wasn’t able to connect the Fire TV via Android TV Remote. But my hope was that since the Firemote card was able to connect to it, then there “should” be a way to connect to it if I can figure out the right YAML…

Any suggestions on how to modify the script below is definitely welcome!

sequence:
  - action: media_player.play_media
    metadata: {}
    data:
      media_content_type: url
      media_content_id: com.retroarch
    target:
      entity_id: media_player.fire_tv_192_168_0_57

1 post - 1 participant

Read full topic

I'm just starting. Are there easy templates to use?

$
0
0

What is the best tube, etc to set up my account. Are there available templates that can be used? Someone to call??

1 post - 1 participant

Read full topic

Sonoff Zigbee Bridge to Zigbee Bridge Pro migration

$
0
0

I’m using sonoff zigbee bridge since 3+ years and would like to upgrade it to Sonoff zigbee bridge Pro.

I’ve set up the new Bridge-Pro with Tasmota and have connected one sensor as a test as well. Whenever I tried to migrate the bridge in HA using “migrate radio” in ZHA, it doesn’t find the new Bridge-Pro. It always comes up to “failed to connect” message.

Can someone pls help ?

New Sonoff Bridge-Pro

3 posts - 2 participants

Read full topic

Reolink rich notifications blueprint -request

$
0
0

I am very happy with @jterrace 's reolink rich notifications blueprint for the most part. I understand @jterrace doesn’t have reolink cams anymore, so am wondering if someone else can help.

I’d really like a mute button added to my notifications to snooze/mute notifications for a set period of time, ideally configured via the blueprint. I know nothing about coding, but am wondering if someone is interested in implementing this? I’d be willing to sponsor it.

1 post - 1 participant

Read full topic

Strftime doesn't seem to working properly when used in a automation variable

$
0
0

I get the following error in my automation

UndefinedError: 'str object' has no attribute 'strftime'

alias: TEST
description: ""
triggers: []
conditions: []
actions:
  - variables:
      varA: "{{ now()  }}"
      varB: "{{ varA.strftime('%Y-%m-%d') }}"
mode: single

But the following works in Jinja…

{% set varA = now() %}
{% set varB =  varA.strftime('%Y-%m-%d')   %}

{{ varB }}

2 posts - 2 participants

Read full topic

Mqtt warning "Payload null is not a number"

$
0
0

Heyhey
In my logs I receive a warning from mqtt. It sais:

Logger: homeassistant.components.mqtt.number
Quelle: components/mqtt/number.py:178
Integration: MQTT (Dokumentation, Probleme)
Erstmals aufgetreten: 21. April 2025 um 17:53:02 (4 Vorkommnisse)
Zuletzt protokolliert: 21. April 2025 um 17:55:05

Payload ‘null’ is not a Number

Via Mqtt Im using z2m, some Nukis, and my go e charger.
How to find out what is causing the error?

1 post - 1 participant

Read full topic


VA added but can not finish the voice setup

$
0
0

I was able to add the device


but I can not finish the setup

I have factory reset a few times now,

  1. To put it on the same network as HA
  2. To change the port of HA to default 8123 thinking this might be the issue

I can turn the light on the VA from HA but it looks like VA can not speak with HA, confused on what else to try

I can see


1 post - 1 participant

Read full topic

BLE Beacon with iOS Automation to open garage door

$
0
0

Hi, I have a Meross MSG200 garage door opener capable of controlling 3 garage doors. My garage has 3 doors and all are used between 2 cars and a motorbike. The cars/bike are always parked in the same space so each door can be assigned to each vehicle in HA. The Meross is connected to apple Homekit through a Homepod Mini and is exposed to Home Assistant through the HomeKit Device Integration. The individual doors can be controlled with both Home Assistant and also Apple Home apps. The problem I have is when in the car and my phone is connected to carplay, the Siri suggestion to open or close a garage door pops up on the carplay home screen as it should within a certain radius of home, but there is no way to choose which of the 3 doors needs to be controlled. Siri only presents an option for one door which may or may not be the correct door.

The alternative is to use the Home Assistant carplay app, where I have the option to control whichever door I want by tapping on the desired door button shown on the screen. All 3 door buttons are displayed at once in the HA carplay app. That works well, however there is no safeguard to prevent a door accidentally being opened if I am far from home.

I have been experimenting with using and ESP32 board setup as an iBeacon so the beacon creates an “enable” signal for the open/close command in HA so that carplay will only work if my phone is within range of the iBeacon. This is where I am stuck. I don’t know how to have my phone automatically detect when the beacon comes within range of the beacon. Creating an iOS automation in the shortcuts app to do “something” when connected/disconnected from bluetooth doesn’t work because the beacon doesn’t show up as one of the bluetooth devices. I can manually scan for the beacon using one of several BLE beacon apps and the beacon is detected but I don’t know how to automatically detect a beacon when it comes into range. I assume the bluetooth connected or disconnected trigger in iOS automations doesn’t work with BLE devices.

The other option that comes to mind is to have a beacon in each car and have a device in the garage to monitor when a beacon comes within range and depending which beacon is detected, the correct door can be enabled to open or close.

I could use some help to point me in the right direction because I have confused myself trying to figure this out. I’m sure there is a simple way to do it. Thanks in advance for your help.

1 post - 1 participant

Read full topic

Smart Meter values to Energy dash

$
0
0

Hi!

I have a Tasmota based reading head to get values from my smart meter via MQTT and the HA Tasmota integration. One of the sensor values looks like this:

image

Unfortunately, I cannot include this value in the energy dash since device_class, state_class and unit_of_mesurement are missing as mentioned here.

What am I doing wrong? What is the recommended way to get the values to the energy dashboard?

Thanks a lot!

Thorsten

1 post - 1 participant

Read full topic

Find and purge sensors or entitys orphans

$
0
0

hi , exist an method for find a unused sensors , entitys in HA ? Or exist an application to execute this controls or check and purge with security method these ?

4 posts - 3 participants

Read full topic

Rendering strings in state template of trigger-based sensor

$
0
0

I try to make some kind of syslog screen to display debug messages from my DIY device, getting them over MQTT. I use a Markdown card to display {{ states(‘sensor.log’) }} .
The incoming MQTT messages are text strings separated by ‘\n’ (2 symbols). Message can contain one or many such strings.
When receiving, HA converts combination of ‘\’ and ‘n’ into one new line symbol (for my opinion).
Idea is to replace on screen as many most oldest string lines as was new received.
My 1st realization was successful and represents a chain of trigger-based template sensors :

template:
  - trigger:
      - trigger: state
        entity_id: text.iot_6_l
    sensor:
      - name: iot_6_log_4
        state: >
          {{ states('sensor.iot_6_log_3') }}
        attributes:
          was_upd: >
            {{ as_timestamp(now()) }}
  - trigger:
      - trigger: state
        entity_id: sensor.iot_6_log_4
        attribute: was_upd
    sensor:
      - name: iot_6_log_3
        state: >
          {{ states('sensor.iot_6_log_2') }}
        attributes:
          was_upd: >
            {{ as_timestamp(now()) }}
  - trigger:
      - trigger: state
        entity_id: sensor.iot_6_log_3
        attribute: was_upd
    sensor:
      - name: iot_6_log_2
        state: >
          {{ states('sensor.iot_6_log_1') }}
        attributes:
          was_upd: >
            {{ as_timestamp(now()) }}
  - trigger:
      - trigger: state
        entity_id: sensor.iot_6_log_2
        attribute: was_upd
    sensor:
      - name: iot_6_log_1
        state: >
          {{ states('sensor.iot_6_log_0') }}
        attributes:
          was_upd: >
            {{ as_timestamp(now()) }}
  - trigger:
      - trigger: state
        entity_id: sensor.iot_6_log_1
        attribute: was_upd
    sensor:
      - name: iot_6_log_0
        state: >
          {{ states('text.iot_6_l') }}
        attributes:
          was_upd: >
            {{ as_timestamp(now()) }}

Here the most oldest lines are in ‘sensor. iot_6_log_4’. It receives a signal about newly received message and replaces its current state with the state of “previous” sensor in chain and changing own attribute ‘was_upd’.
This triggers a “previous” sensor, who performs similar actions with own “previous” neighbor in chain, and so on to the first sensor in chain who replaces its current state with the newly received message.
The chain of that sensors is represented on HA dashboard with vertical stack of Markdown cards
This scheme works as expected with the only drawback: each card in stack can contain from one to several lines and therefore screen updates may occur unevenly. In addition, there is an unused space between the cards.
All this logically leads to the idea of implementing a similar mechanism in a single sensor and use a single Markdown card.
Here it is:

template:
  - trigger:
      - trigger: state
        entity_id: text.iot_6_l
    sensor:
      - name: iot_6_log
        state: >
          {% set log_raw = [this.state | default(''), states('text.iot_6_l')]|join('\n') %}
          {% set log_text = log_raw.split('\n') %}
          {% set scr_lines = states('input_number.iot_6_log_scr')|int(10) %}
          {% set screen = namespace(log = "") %}
          {% for line in log_text %}
          {% if ((loop.length - loop.index) < scr_lines) %}
          {% if (screen.log == "") %}
          {% set screen.log = line %}
          {% else %}
          {% set screen.log = [screen.log, line]|join('\n') %}
          {% endif %}{% endif %}{% endfor %}
          {{ screen.log }}

Here after receiving trigger signal the current state is joined with new message adding separator ‘\n’. Next, whole text is divided into lines removing the separators ‘\n’.
After, in loop the new text is creating with filtering by allowed number of lines on screen.
For my opinion this must work but…
Result is kinda strange. New lines are appearing an disappearing in random time and random amount.
I found a mention in the documentation that
" The state template must not render to a string, including unknown or unavailable ."
But my working chain successfully uses such templates.
And before “must not render” there is a text “If the sensor is numeric,…”
Resuming, please verdict if my idea is realizable (maybe errors in my template or something else) or it’s the case when “must not render to a string”.
Any opinion will be appreciated.

1 post - 1 participant

Read full topic

Heatit Z-relay 25A not updating temp values after specified time

$
0
0

Hi, I have a problem with Heatit Z-relay 25A, when temp values are not updating. Or better to say, they update after about 6 hours, even when parameters 7 and 8 are set to any value. I use Zwave JS integration with AEOTEC Z-Stick 7 (FW: 7.21.4).
All other parameters seams to work. DO I have to switch to Z-Wave JS to MQTT, or can this be resolved on normal Z-Wave JS? Thank you

1 post - 1 participant

Read full topic

Extract number entity from humidifier

$
0
0

Hi!
I have a humidifier and I need to extract only number entity from it to control target humidity.
I believed it would be easy to pass data of setpoint from input_number to humidifier via automations but it didnt work :frowning:
Is it possible and how I am supposed to do this?

alias: Test target hum
description: ""
triggers: []
conditions: []
actions:
  - data:
      humidity: "{{ humidity('humidifier.home_humidifier') }}"
    target:
      entity_id: input_number.test_hum
    action: input_number.set_value
mode: single

1 post - 1 participant

Read full topic


Non-existent entity causes warning - once an hour

$
0
0

I have a strange entry filling my logs:

Logger: homeassistant.helpers.entity_component
Source: helpers/entity_component.py:55
First occurred: April 21, 2025 at 5:00:00 PM (21 occurrences)
Last logged: 1:00:00 PM

Forced update failed. Entity binary_sensor.updater not found.

Interestingly, I do NOT have a binary_sensor.updater sensor (Ok, that’s exactly it complains about). But I can’t figure out what is looking for it. I searched all my .yaml files and none of them contains the sting binary_sensor.updater.

Any idea where it may come from?

1 post - 1 participant

Read full topic

Energy sensor shows wrong values in the energy dashboard

$
0
0

Hi everybody,

I’m currently using Home Assistant 2025.4.3 on my Raspberry 5 with the Sonoff Zigbee-Dongle and Zigbee2MQTT.

From one day to another my energy dashboard displayed some crazy high values for 3 of my smart plugs.
All smart plugs are the same brand and model, only 3 of them seem to display incorrect values.
As a result 3 devices show up in the energy Dashboard with very high energy values like 31,83 Kwh in just 1 hour, which is impossible.

(I would add a picture but I’m new around here, so I’m only allowed to use 1 picture)

The total energy consumption also seems to be incorrect as a result, it shows 356 kwh in just 24hours.

I noticed that the devices themselves seem to have the correct values, at least the value “total energy” seems to be ok. But I also noticed a very strange behaviour by looking at the displayed graph.
The values seem to “flicker” and I’m pretty sure this is the cause of my issues.

All of the 3 “faulty” smart plugs show this kind of problem.
The other 7 smart plugs are fine and showing a steady and continuously ascending graph.
Zigbee2MQTT itself also shows the correct total values.

I tried reconnecting the devices in Zigbee2MQTT, but this didn’t fix the issue.
I can’t find an issue in the devevopler tools aswell.
Also all the smart plugs should be configured the same.

Can this type of issue be caused by an unavaiability of the device/sensor?
How can I prevent this problem in the future?

Thanks in advance!

1 post - 1 participant

Read full topic

Haier/Candy Washing Machine Card

$
0
0

Was doing custom card for Haier/Candy washing machine and since there wasnt any decided to share it if someone would need it.

All is based on Haier hOn integration made/forked by gvigroux which is aviable in HACS/github
Card looks like that:


(red text on image are only descriptions for purpose of explaining sections - they aren’t in actual card)

Main steps are:

  • creating additional sensor
  • creating card

1. Creating sensor

To card work properly, in first step need to create sensor that will be needed to progress bar work properly, and will calculate percentage remaining time instead only showing remaining time in minutes, which progress bar wont be able to understand.
Sensor will be using provided by hOn integration sensors such as:
sensor.[DeviceName]_remaining_time
sensor.[DeviceName]_start_time
sensor.[DeviceName]_remaining_time

Before creating sensor, I recommend installing Studio Code Server which is file editor and its aviable in Home Assistant Settings>Addodns>Shop in bottom right corner. I will expail why later.

Code for sensor is:

- sensor:
    - name: "[SensorName]"
      unique_id: [DeviceUnigue_ID]
      unit_of_measurement: "%"
      state: >
        {% if is_state('sensor.[DeviceName]_remaining_time', 'unavailable') or
              is_state('sensor.[DeviceName]_remaining_time', 'unknown') or
              is_state('sensor.[DeviceName]_start_time', 'unavailable') or
              is_state('sensor.[DeviceName]_start_time', 'unknown') %}
          0
        {% else %}
          {% set start_time = as_datetime(states('sensor.[DeviceName]_start_time')) %}
          {% set end_time = as_datetime(states('sensor.[DeviceName]_end_time')) %}
          {% set now = now() %}
          {% set total_duration = (end_time - start_time).total_seconds() %}
          {% set elapsed_time = (now - start_time).total_seconds() %}
          {% set progress = elapsed_time / total_duration * 100 %}
          {{ [0, [100, progress]|min]|max|round(1) }}
        {% endif %}
      icon: mdi:washing-machine
      availability: >
        {{ not is_state('sensor.[DeviceName]_remaining_time', 'unavailable') and 
           not is_state('sensor.[DeviceName]_start_time', 'unavailable') and
           not is_state('sensor.[DeviceName]_end_time', 'unavailable') }}

To create sensor use Studio Code Server and edit templates.yaml file.
If you dont have that file just create it in primary directory (in te same directory as configuration.yaml)

During creating sensor, you need to change few things.

First is that need to generate Unique_Id for that sensor. Delate [DeviceUnigue_ID] and later right click and from context menu choose “Generate UUID at cursor”. Generating UUID is way easier/faster in Studio Code Server just because it have that option in context menu so you dont need to generate it, lets say manually. So convenience is kinda only reason why ealier i recommended instaling Studio Code Server.

Second is that need to change all [DeviceName] from code to your device name in your home assistant.

Last is to rename sensor name from [SensorName] to your desired name, for example WMpercentgesensor or whatever name you want, but keep in mind that name of that sensor need to be in quotes “”

To save changes made in templetes.yaml, press ctrl+s. Its Studio Code Server key shourtcut for Save edited files.

2. Creating Card

Just simply copy/paste code to your dashboard.
Here is code for card:

type: custom:button-card
entity: sensor.[DeviceName]_mode
name: [DeviceName]
show_icon: true
icon: mdi:washing-machine
show_label: true
state:
  - value: "0"
    label: Turned Off
    styles:
      grid:
        - grid-template-areas: "\"i n\" \"program program\" \"phase phase\" \"l l\" \"bar bar\""
        - grid-template-columns: auto 1fr
      name:
        - justify-self: start
        - align-self: start
        - font-size: 26px
        - color: var(--black)
        - padding-left: "-8px"
        - padding-top: 14px
        - opacity: "0.7"
      label:
        - justify-self: start
        - font-size: 40px
        - font-weight: 400
        - color: var(--black)
        - padding: 10px 0px 20px 20px
      custom_fields:
        program:
          - display: none
        bar:
          - display: none
        phase:
          - display: none
        time_container:
          - display: none
  - value: "7"
    label: Washing End
    styles:
      grid:
        - grid-template-areas: >-
            "i n" "program program" "phase phase" "l l" "time_container
            time_container" "bar bar"
        - grid-template-columns: auto 1fr
      name:
        - justify-self: start
        - align-self: start
        - font-size: 26px
        - color: var(--black)
        - padding-left: "-8px"
        - padding-top: 14px
        - opacity: "0.7"
      label:
        - justify-self: start
        - font-size: 40px
        - font-weight: 400
        - color: var(--black)
        - padding: 10px 0px 20px 20px
      custom_fields:
        program:
          - display: none
        bar:
          - display: none
        phase:
          - display: none
        time_container:
          - display: none
styles:
  card:
    - padding: 0
    - height: 180px
    - border-radius: 20px
    - background: null
  grid:
    - grid-template-areas: >-
        "i n" "phase phase" "program program" "l l" "time_container
        time_container" "bar bar"
    - grid-template-columns: auto 1fr
  name:
    - justify-self: start
    - align-self: start
    - font-size: 26px
    - color: var(--black)
    - padding-left: 0px
    - padding-top: 14px
    - opacity: "0.7"
  label:
    - justify-self: start
    - font-size: 40px
    - font-weight: 400
    - color: var(--black)
    - padding: 10px 0px 20px 20px
  img_cell:
    - justify-self: start
    - align-self: start
    - margin: 10px 0 0 10px
    - background: rgba(var(--highlight_active))
    - padding: 14px
    - border-radius: 50%
    - width: 20px
    - height: 10px
  icon:
    - width: 27px
    - height: 27px
    - color: var(--black)
  custom_fields:
    program:
      - justify-self: start
      - font-size: 25px
      - font-weight: 300
      - color: var(--black)
      - padding: 0 5px 28px 24px
    phase:
      - justify-self: start
      - font-size: 20px
      - font-weight: 300
      - color: var(--black)
      - padding: 10px 5px 10px 23px
      - opacity: "0.8"
      - margin-top: "-5px"
    time_container:
      - width: 90%
      - justify-self: center
      - font-size: 14px
      - font-weight: 300
      - color: var(--black)
      - margin: "-15px 0px 5px 0px"
      - display: flex
      - justify-content: space-between
    bar:
      - justify-self: center
      - width: 90%
      - border-radius: 6px
      - background: "#D4C9BE"
      - height: 12px
      - margin: 0px 0px 20px 0px
      - position: relative
custom_fields:
  program: |
    [[[ 
      // Get remaining time from sensor
      const remainTimeSensor = states['sensor.[DeviceName]_remaining_time'];
      const remainTime = (remainTimeSensor && remainTimeSensor.state !== 'unavailable' && remainTimeSensor.state !== 'unknown') ? 
        remainTimeSensor.state : '-';
      
      // Get mode from sensor to determine machine status
      const modeSensor = states['sensor.[DeviceName]_mode'];
      const mode = (modeSensor && modeSensor.state !== 'unavailable' && modeSensor.state !== 'unknown') ? 
        modeSensor.state : '0';
      
      // Format remaining time from minutes to HH:MM with Polish text
      let formattedTime = '-';
      if (!isNaN(parseInt(remainTime))) {
        const hours = Math.floor(remainTime / 60);
        const minutes = remainTime % 60;
        formattedTime = (hours > 0 ? hours + ' hour. ' : '') + minutes + ' min.';
      }
      
      // Only show time if machine is not in standby
      if (entity.state !== 'standby' && mode !== '0') {
        return '<div style="text-align: center; font-size: 25px;">End In: ' + formattedTime + '</div>';
      } else {
        return '';
      }
    ]]]
  phase: |
    [[[
      // Get program phase from sensor
      const phaseSensor = states['sensor.[DeviceName]_program_phase'];
      const phaseState = (phaseSensor && phaseSensor.state !== 'unavailable' && phaseSensor.state !== 'unknown') ? 
        phaseSensor.state : '';
      
      // Get mode to determine if we should show the phase
      const modeSensor = states['sensor.[DeviceName]_mode'];
      const mode = (modeSensor && modeSensor.state !== 'unavailable' && modeSensor.state !== 'unknown') ? 
        modeSensor.state : '0';
      
      // Map phase state to display text
      let phaseText = '';
      if (phaseState === '0') {
        phaseText = 'Ready';
      } else if (phaseState === '2') {
        phaseText = 'Washing';
      } else if (phaseState === '4') {
        phaseText = 'Rinse';
      } else if (phaseState === '11') {
        phaseText = 'Spin';
      } else if (phaseState) {
        // For any other states, just display the state number with a generic label
        phaseText = 'Phase ' + phaseState;
      }
      
      // Only show phase if not in standby and mode is valid
      if (entity.state !== 'standby' && mode !== '0' && phaseText) {
        return phaseText;
      } else {
        return '';
      }
    ]]]
  time_container: |
    [[[
      // Get mode to determine if we should show the time information
      const modeSensor = states['sensor.[DeviceName]_mode'];
      const mode = (modeSensor && modeSensor.state !== 'unavailable' && modeSensor.state !== 'unknown') ? 
        modeSensor.state : '0';
      
      // Only show time info if not in standby and mode is not 0
      if (entity.state === 'standby' || mode === '0' || mode === '7') {
        return '';
      }
      
      // Get remaining time from sensor
      const remainTimeSensor = states['sensor.[DeviceName]_remaining_time'];
      const remainTime = (remainTimeSensor && remainTimeSensor.state !== 'unavailable' && remainTimeSensor.state !== 'unknown') ? 
        remainTimeSensor.state : '0';
      
      // Get progress percentage from sensor
      const progressSensor = states['[SensorName]'];
      const progress = (progressSensor && progressSensor.state !== 'unavailable' && progressSensor.state !== 'unknown') ? 
        parseFloat(progressSensor.state) : 0;
      
      // Calculate start time based on current time
      const now = new Date();
      
      // Calculate total minutes based on remaining time and progress
      const totalMinutes = progress > 0 ? Math.round(remainTime / ((100 - progress) / 100)) : 0;
      const elapsedMinutes = totalMinutes - remainTime;
      
      // Calculate start time by subtracting elapsed minutes from current time
      const startTime = new Date(now.getTime() - elapsedMinutes * 60000);
      const startHours = startTime.getHours().toString().padStart(2, '0');
      const startMinutes = startTime.getMinutes().toString().padStart(2, '0');
      
      // Calculate end time by adding remaining minutes to current time
      const endTime = new Date(now.getTime() + remainTime * 60000);
      const endHours = endTime.getHours().toString().padStart(2, '0');
      const endMinutes = endTime.getMinutes().toString().padStart(2, '0');
      
      // Format start and end times
      const formattedStartTime = startHours + ':' + startMinutes;
      const formattedEndTime = endHours + ':' + endMinutes;
      
      return `<div style="display: flex; justify-content: space-between; width: 100%;">
                <div>${formattedStartTime}</div>
                <div>${formattedEndTime}</div>
              </div>`;
    ]]]
  bar: |
    [[[
      // Get mode to determine if we should show the bar
      const modeSensor = states['sensor.[DeviceName]_mode'];
      const mode = (modeSensor && modeSensor.state !== 'unavailable' && modeSensor.state !== 'unknown') ? 
        modeSensor.state : '0';
      
      // Only show bar if not in standby and mode is not 0
      if (entity.state === 'standby' || mode === '0' || mode === '7') {
        return '';
      }
      
      // Get progress percentage from sensor
      const progressSensor = states['[SensorName]'];
      const progress = (progressSensor && progressSensor.state !== 'unavailable' && progressSensor.state !== 'unknown') ? 
        progressSensor.state : '0';
      
      // Return the bar with correct width percentage - without remaining time text
      return `<div style="position: relative; height: 12px;">
                <div style="background: #A58D84; height: 12px; width: ${progress}%; border-radius: 6px 0 0 6px;"></div>
              </div>`;
    ]]]

To adjust card to your device, you need to change all [DeviceName] from orginal hOn sensors to your device name, for example sensor.YOURNAME_remaining_time.
Just to be clear, i dont mean renaming entities in integration, only renaming in card code.

Next is that need to change [SensorName] in card code to name you decide to name sensor when was creating it in first step.

Another thing is that since hOn integration washing phases states are based on numeric values and integration itself translate them to phase names, there can be errors when displaying phases names because, im guessing here since i tested only on my washing machine and totaly dont sure about it, different models can have different state code/number for particular phases. For example, in my washing machine i counted five defferent state value codes/numbers only for Washing phase.
If you will have that problem, to fix it you need to change in card code phase values to your device code/number.
For example my phases are as below:

// Map phase state to display text
      let phaseText = '';
      if (phaseState === '0') {
        phaseText = 'Ready';
      } else if (phaseState === '2') {
        phaseText = 'Washing';
      } else if (phaseState === '4') {
        phaseText = 'Rinse';
      } else if (phaseState === '11') {
        phaseText = 'Spin';
      } else if (phaseState) {
        // For any other states, just display the state number with a generic label
        phaseText = 'Phase ' + phaseState;
      }

In my device phase values are: 0=Ready, 2=Washing, 4=Rinse, 11=Spin

In your device thise values can be different for particular phases.
To check what value your device have for particular phase, just run washing program and go to Home Assistant develoter tools and in states tab filter for phase sensor as on image below and note what your device values are for particular phases. Values will be changing with program phase changes.

Last thing is that you can do cosmetic changes to adjust card to your launguage.
Haier hOn integration made/forked by gvigroux is made in english and dont have translations, so some parts of code are only made to change default english names to my native language.
If you want adjust card to your language, just simply change all english names/labels in code such as Spin, Washing, Rinse, and so on, to names in your language. For purpose of sharing all labels in code are in english, so it will be easier to find them in card code.

1 post - 1 participant

Read full topic

MQTT entity does not show numeric value

$
0
0

Hi all,

I’m trying to integrate a humidity sensor in HA using MQTT. My payload looks like the following (I’m testing it with mosquitto_pub):

mosquitto_pub -h 123.123.123.123 -t garden/humidity/vegetables -m '{"humidity": 87.324, "timestamp": 1745310200}' -u mqtt -P mqtt

My configuration in configuration.yaml looks like this:

mqtt:
  sensor:
    - name: "Veggie garden"
      unit_of_measurement: "%"
      state_topic: "garden/humidity/vegetables"
      value_template: "{{ value_json.humidity | float }}"
      force_update: true

However, when I look at the entity, it does not show anything:

Could somebody please tell me what I’m missing or doing wrong?

1 post - 1 participant

Read full topic

Matter device commissioning via another app

$
0
0

I have created my own Android app, and I have implemented the commissioning process using Google Play Services. The commissioning process succeeded when trying to add the matter device.
passed all the steps like

  • searching device,
  • connecting device,
  • generating Matter credentials,
  • device connected to the network,
  • device connected to the <app_name>,
  • And finally device is connected.

Now, how to insert this Matter device into Home Assistant server, I need to see this device in the devices list (Settings → devices & services). How to achieve this?

1 post - 1 participant

Read full topic

Viewing all 107201 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>