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

Play music from Music Assistant

$
0
0

I’ve seen how to create a custom sentence that has variables that can later be used in the action. But from what I’ve seen, I have to hard coded the list of possible values.

But I want to be able to tell my VPE “Play {source}”. Source can be any source known to Music Assistant. But I don’t want to have to update the sentence every time I add a new source to or delete a source from Music Assistant.

Is there a way to automate this process that I’m just not seeing from my research so far?

2 posts - 2 participants

Read full topic


Newbie Issue: Failure to start Zigbee2MQTT

$
0
0

OK, just got the Sonoff Zigbee 3.0 USB Dongle Plus, which HA OS on x86 recognized. Installed Mosquitto without issues, but Zigbee2MQTT keeps throwing these errors:

[15:53:45] INFO: Preparing to start…
[15:53:45] INFO: Socat not enabled
[15:53:45] INFO: Starting Zigbee2MQTT…
Starting Zigbee2MQTT without watchdog.
[2025-02-18 15:53:46] info: z2m: Logging to console, file (filename: log.log)
[2025-02-18 15:53:46] info: z2m: Starting Zigbee2MQTT version 2.1.1 (commit #unknown)
[2025-02-18 15:53:46] info: z2m: Starting zigbee-herdsman (3.2.5)
[2025-02-18 15:53:46] info: zh:ember: Using default stack config.
[2025-02-18 15:53:46] info: zh:ember: ======== Ember Adapter Starting ========
[2025-02-18 15:53:46] info: zh:ember:ezsp: ======== EZSP starting ========
[2025-02-18 15:53:46] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:46] info: zh:ember:uart:ash: RTS/CTS config is off, enabling software flow control.
[2025-02-18 15:53:46] info: zh:ember:uart:ash: Serial port opened
[2025-02-18 15:53:46] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:49] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:49] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:51] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:51] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:54] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:54] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:56] info: zh:ember:uart:ash: ======== ASH Adapter reset ========
[2025-02-18 15:53:56] info: zh:ember:uart:ash: ======== ASH starting ========
[2025-02-18 15:53:59] error: z2m: Error while starting zigbee-herdsman
[2025-02-18 15:53:59] error: z2m: Failed to start zigbee-herdsman
[2025-02-18 15:53:59] error: z2m: Check Zigbee2MQTT fails to start/crashes runtime | Zigbee2MQTT for possible solutions
[2025-02-18 15:53:59] error: z2m: Exiting…
[2025-02-18 15:53:59] error: z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.
at EmberAdapter.initEzsp (/app/node_modules/.pnpm/zigbee-herdsman@3.2.5/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:670:19)
at EmberAdapter.start (/app/node_modules/.pnpm/zigbee-herdsman@3.2.5/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1533:24)
at Controller.start (/app/node_modules/.pnpm/zigbee-herdsman@3.2.5/node_modules/zigbee-herdsman/src/controller/controller.ts:136:29)
at Zigbee.start (/app/lib/zigbee.ts:69:27)
at Controller.start (/app/lib/controller.ts:142:13)
at start (/app/index.js:161:5)

I’ve confirmed the Sonoff is recognized in HA via both via terminal and in HA hardware:

/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0
/dev/ttyUSB0

so have been testing both of these serial configurations in Z2M:

serial: port: >- /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_98c59f933e6cef11855397adc169b110-if00-port0

serial: port: >- /dev/ttyUSB0

I’ve tried using ‘ezsp’ as the adapter callout here too, it’s even worse - this starts repeating if so:

error: Error: Failure to connect
[2025-02-18 13:01:21] error: zh:ezsp:uart: → Error: Error: {“sequence”:-1} after 10000ms

I also flashed the adapter with CC1352P2_CC2652P_launchpad_coordinator_20240710.hex, to see if that made a difference. Same thing.

Also, I did not set up the Sonoff in the discovered devices, as I didn’t want ZHA to interfere.

I know I’m screwing something up, just don’t know what… thanks for anyone who can help me!

2 posts - 2 participants

Read full topic

Very nice and all of you want to all of you want to all of you want to all of you want to all of you want

$
0
0

Up next to the winter Soldier trailer of you want to all of you want to all of you want to all of you want to all of you want to all of you want to

1 post - 1 participant

Read full topic

How to group input devices and use the group in a blueprint?

$
0
0

I have a bunch of Tuya Rotary buttons, for which I created a blueprint.

I have several scenarios where I want two or more of these to do exactly the same, for example one button at each end of a hallway (like a traditional three-way switch).

HA Groups seems like a good way to do this. I’ve used groups a fair bit with output devices (lights, active speakers) and sensors (windows open / closed), but this would be my first time grouping input devices.

The grouping works ok, but I seem to be unable to listen to events from any of the input devices in the group in the blueprint.

Here is my attempt: (click for more details)

This lets me assign a group (e.g. button.rotary_buttons_hallway), but then the blueprint never triggers.
How can I listen to the events from the buttons when they are in a group?

2 posts - 2 participants

Read full topic

Voice Assistant PE unable to connect to Docker HA

$
0
0

New device arrived today. Excited to get it hooked up but I’m having issues.
I’ve read the other threads similar to my issue but I’m not getting past this point

The voice assistant is unable to connect to Home Assistant

I have Home Assistant installed on linux box inside a docker container with bridge networking.

  • the container is exposing port 8123
  • Outbound is allowed
  • inbound from 192.168.0.0/24 to port 8123 is allowed

I have the device on my network and it’s been given an IP by the router
I have added the VA device to ESPHome using that IP

When I try to go throught the ESPHome > Setup Voice Assistant wizard I ge tthe “The voice assistant is unable to connect to Home Assistant” error with the sad robot.

I have edited my “Settings > System > Network” to have the external web address box empty and the local set for “Automatic” to false and the Local address to be the static LAN IP of the linux box.

I’ve run out of ideas for what to do. Any suggestions? HA can reach the device (I’m able to change the LEDs etc) The device doesn’t appear to be able to know how to reach HA. HA is routable and reachable from other wifi devices on the same network.

1 post - 1 participant

Read full topic

Reolink HA captures camera stream and does not release it

$
0
0

Perhaps I’m doing something wrong but, before I installed the Relolink integration and added my cameras to it, I could access the cameras from both the NVR and from the Reolink app on my PC. After installing the the HA integration, I can no longer access the cameras on from the Reolink app on my PC. I know the cameras have limitations on the total number of streaming connections and hypothesize that the HA integration is not releasing the camera streams causing the PC app not to be able to open a stream. Has anyone else experienced this and/or have a work-around?

Thanks,
Mike

1 post - 1 participant

Read full topic

Template editor error

$
0
0

I am trying to test out a template in the template editor under developer tools. I practically copy/pasted most of what I have in there from another topic here but I get the error “UndefinedError: ‘daily_forecast’ is undefined”

Am i not defining it here under “response_variable”?

- trigger:
    - trigger: time_pattern
      hours: /1
    - trigger: homeassistant
      event: start
  action:
    - action: nws.get_forecasts_extra
      data:
        type: twice_daily
      target:
        entity_id: weather.kofp
      response_variable: daily_forecast
  sensor:
    - name: "NWS Daily Forecast"
      unique_id: "nws_daily_forecasts"
      state: "{{now() }}"
      attributes:
        forecast_0: "{{ daily_forecast['weather.kofp'].forecast[0].detailed_description }}"
        forecast_1: "{{ daily_forecast['weather.kofp'].forecast[1].detailed_description }}"

3 posts - 3 participants

Read full topic

Creating a Daily Counter Readout from a Total Lifetime Counter Sensor

$
0
0

Hi everyone,

I’m trying to create a daily click counter in Home Assistant using my sensor.whatpulse_clicks_sensor, which tracks lifetime clicks. My goal is to:

  1. Track daily clicks by subtracting the previous day’s total from the current total.
  2. Store the total clicks at midnight so that I can use it for calculations the next day.
  3. Have the daily clicks update dynamically without breaking on restart.

Attempts So Far:

I first tried using an input_number helper (input_number.whatpulse_total_clicks_thru_yday) to store the midnight value and an automation to update it at midnight:

- alias: "Store WhatPulse Clicks at Midnight"
  id: store_whatpulse_clicks_midnight
  trigger:
    - platform: time
      at: "00:00:00"
  action:
    - service: input_number.set_value
      target:
        entity_id: input_number.whatpulse_total_clicks_thru_yday
      data:
        value: "{{ states('sensor.whatpulse_clicks_sensor') | int }}"
  mode: single

Then, I tried creating a template sensor to calculate daily clicks:

template:
  - sensor:
      - name: "WhatPulse Clicks Today"
        unique_id: whatpulse_clicks_today
        state: "{{ states('sensor.whatpulse_clicks_sensor') | int - states('input_number.whatpulse_total_clicks_thru_yday') | int }}"
        unit_of_measurement: "clicks"

Problems Encountered:

  1. “Message malformed: value should be a string for dictionary value” – When trying to save automations in the UI.
  2. Math on input_number not working – Home Assistant doesn’t seem to allow direct math operations on input_number helpers in template sensors – is this true? Maybe my code is wrong.
  3. Tried converting input_number to a sensor, but then got "extra keys not allowed @ data['0']" when saving the config.
  4. Even when it saves, the template sensors show as “unavailable” on my dashboard.

I’ve seen some solutions suggesting template sensors instead of input_number, but I can’t get things to persist across reboots.

Has anyone successfully created a daily counter like this? Any guidance would be appreciated!

Thanks in advance!

2 posts - 2 participants

Read full topic


Triggering switch with weather.forecast_home_hourly

$
0
0

I am new to this and tried searching for related issues, but I didn’t see any.
I am simply trying to activate/deactivate my Kasa outlets in my greenhouse based on timed checks of the weather.forecast_home_hourly entity.
To activate, I have the plug set to check the weather.forecast_home_hourly every 30 minutes to see if the current temp is below 36 degrees:

alias: Tree Lights On
description: "Turn lights on to warm trees."
trigger:
  - platform: time_pattern
    minutes: "30"
condition:
  - condition: numeric_state
    entity_id: weather.forecast_home_hourly
    attribute: temperature
    below: 36
action:
  - type: turn_on
    device_id: 4ef0a41a0f39bee838dccbc223d01ba1
    entity_id: switch.right_plug
    domain: switch
mode: single

And to turn off the plug:

alias: Tree Lights Off
description: Turn off tree warming lights.
trigger:
  - platform: time_pattern
    minutes: "45"
condition:
  - condition: numeric_state
    entity_id: weather.forecast_home_hourly
    attribute: temperature
    above: 35
action:
  - type: turn_off
    device_id: 4ef0a41a0f39bee838dccbc223d01ba1
    entity_id: switch.right_plug
    domain: switch
mode: single

I have tested this a lot the last two weeks. The plug and lights turn off accurately, but they don’t seem to activate correctly, and I always end up manually activating the lights. Can anyone give me some tips on reliably activating these lights based on current temps?

Thank you.

3 posts - 3 participants

Read full topic

Troubleshooting apparent timezone mixup with same timezone for HA and virtualization

First Time Using Matter

$
0
0

I’ve been hearing about Matter here and there for a while, but since its support is still Beta I never bothered trying it. That was until a couple of days ago after buying the Govee strip H612F and finding out that they are not supported by Govee Lights Local. Only one option was left for local control, for that matter (pun intended).

Perusing the docs hit the first bump: IPv6 is required. I always dismissed configuring my very segmented and filtered home network for IPv6 because it wasn’t worth the trouble. But with this new motivation I started to dust off my rusty concepts on the topic. A few areas were assured to guarantee headache: the router (a Cisco model), the firewall (also Cisco) and the DHCP server (Windows built-in). Hour after hour of research, trial and error finally got me to the milestone of being able to get a (unique local) IPv6 address across subnets and having other needed access through the firewall. Then gave HA its IPv6 config, tested it and moved onto the next step.

Matter setup. Very easy, simply enable the integration, let it install the Matter server addon and commission the Govee using the Companion…, not so fast. Commissioning would just fail. Checking the addon logs got the other bump: it was looking for the device’s link-local address. This was a non-starter because the HA host is segregated on a VLAN away from the IoT junk. (Link-local addresses can’t traverse subnets). So…, “where did I glance something about having your own Matter server (which I guess opens the possibility of having it on different subnet than HA)? Ah, the Matter integration docs.” Which send you to the Matter Server Github so that you can install it wherever you want. Fast forward to the evening when a new Ubuntu Server VM had been stood up on the same VLAN as the IoT, with the matter-server image running on Docker. Then pointed the HA Matter integration to the server websocket URL, which just worked to my surprise.

Ok, moment of the truth, try to commission the Govee again. Factory reset it, scanned the code and saw with delight how each stage advanced on the app until the final Device connected. Went over to HA and there was the device with a bunch of entities.

It’s been about a day and everything works fine controlling and getting status. The only quirk so far (unsurprisingly) is that if I set any transition time when turning the strip on or off, it actually does it with a transition of about 10 seconds.

This is the Matter Server log of the successful commissioning, maybe it could be a helpful reference for someone else:

2025-02-18 04:52:42.397 (MainThread) INFO [matter_server.server.device_controller] Starting Matter commissioning using Node ID 1 and IP fe80::d2c9:7ff:fe82:4b6.
2025-02-18 04:52:44.939 (Dummy-2) INFO [chip.ChipDeviceCtrl] Established secure session with Device
2025-02-18 04:52:58.656 (Dummy-2) INFO [chip.ChipDeviceCtrl] Commissioning complete
2025-02-18 04:52:58.657 (MainThread) INFO [matter_server.server.device_controller] Matter commissioning of Node ID 1 successful.
2025-02-18 04:52:58.657 (MainThread) INFO [matter_server.server.device_controller] Interviewing node: 1
2025-02-18 04:53:07.222 (MainThread) INFO [matter_server.server.device_controller] <Node:1> Setting-up node...
2025-02-18 04:53:07.225 (MainThread) INFO [matter_server.server.device_controller] <Node:1> Setting up attributes and events subscription.
2025-02-18 04:53:07.702 (MainThread) INFO [matter_server.server.device_controller] <Node:1> No new update found.
2025-02-18 04:53:14.911 (MainThread) INFO [matter_server.server.device_controller] <Node:1> Subscription succeeded with report interval [1, 60]
2025-02-18 04:53:14.912 (MainThread) INFO [matter_server.server.device_controller] Commissioning of Node ID 1 completed.

1 post - 1 participant

Read full topic

Astimezone() output differs from server local time zone

$
0
0

Hi Folks,

I’d greatly appreciate your insights on time zones. I haven’t found an answer on my own and I’m just banging my head against the wall at this point.

tl;dr: I have a remote deployment on GMT-3, while my local time is GMT-5. When executing HA templates, some pick up my server time zone, while others pick up my local time zone… it is a mess.

Setup
Proxmox 6.8.12-5-pve VM running HAOS 14.2, core 2025.2.4.

root@pve00:~# date
Wed Feb 19 02:22:38 AM -03 2025

Proper HA time zone configured via

  1. Profile → Time Zone (Use Server Time Zone)
  2. Settings → System- > General (GMT-3)

HA terminal add-on output matches server local time after setting up NTP server for DHCP on my remote router using the right NTP pools/servers.

➜  ~date
Wed Feb 19 02:23:19 -03 2025

Challenges
Some templates work great… others drive me crazy. In particular when trying to display an hourly weather forecast.

Working great:

{{ now() }}
2025-02-19 02:23:47.809414-03:00

Working awfully

{{ now().now() }}
2025-02-19 00:23:47.809432

{{ now().astimezone() }}
2025-02-19 00:23:47.809438-05:00

astimezone() is currently using the same time as the naive approach, which is actually my local time zone - two hours behind the server time zone.

Furthermore:

{{ utcnow().tzinfo }}
UTC

{{ now().tzinfo }}
America/Santiago

{{ now().astimezone().tzinfo }}
EST

If I try to get the weather forecast for the next hour, I get it on my local time zone, instead of the server time zone… needless to say, this is absolutely useless to me.

{% set forecast_time = (state_attr('sensor.forecast', 'forecast') | map(attribute='datetime') | list)[0] %}
{% set dt = strptime(forecast_time, '%Y-%m-%dT%H:%M:%S%z') %}
{{ dt.astimezone().strftime('%-I%p %z').strip() }}
1AM -0500

The expected output above should’ve been 3AM -0300.

What I’ve tried

  • Configuring Chrony to set up the system clock. Chrony log shows:
[02:05:12] INFO: Starting chronyd...
2025-02-19T05:05:12Z chronyd version 4.6.1 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 -DEBUG)
s6-rc: info: service legacy-services successfully started
2025-02-19T05:05:12Z Initial frequency -205.829 ppm
2025-02-19T05:05:16Z System's initial offset : 0.045135 seconds slow of true (slew)
2025-02-19T05:05:23Z Selected source 64.176.3.116 (cl.pool.ntp.org)
  • Setting up DHCP NTP server on remote router
  • reconfiguring and resetting everything through the GUI.

Yet, I still get astimezone() modifying server time zone by -5 instead of -3.

Request
All the posts I’ve found with a similar problem seemed to have been solved by the steps above - or at least these were the proposed solutions… If you can point me to any other solution, I’d greatly appreciate it.

Thank you very much in advance.

1 post - 1 participant

Read full topic

Tips on configuring modbus, including working examples of modbus tcp yaml config

$
0
0

This isnt a help request, just opened to share with fellow Home Assistant travellers some hands on notes from recent experience. I trust others will also be free to share the answers to challenges they faced so others can learn too. One thing about modbus is that while the functionality is available in HA, theres not so much experience shared because modbus hasnt been so popular. If a reader can quickly find just one solution to a problem here - that makes it worthwhile

Below is a list of things that had to be learnt for a successful modbus implementation.

Modbus? Its an automation protocol introduced for equipment communication in the late 1970’s. the protocol has only been updated a few times with the current RS485 protocol developed in the 80’s. Very popular in the manufacturing community because its comparatively easy to learn and use. You can Google this and read to your hearts content!.

RS485 is the protocol over which modbus us transmitted. Communication is over a single twisted pair. its easy to find such wire - ethernet cat 5/5e/6 all have 4 twisted pairs inside.

In layman’s terms? RS485 is the roadway on which vehicles travel. modbus tcp is the car/truck/bus whatever you fancy moving along that roadway. The names sometimes get used interchangeably - its OK. We know what your talking about!

It is important to use twisted pair (UTP - Universal Twisted Pair) cable as this helps block EMC interference from other devices. Avoid running your cable too close to VFD/VSD inverters for that reason.

If you have multiple modbus devices to connect, all can be connected together in one network, but the cable must daisy chain from one device to the next… NO junction boxes where the cable turns into a birds nest with dodgy connectors and branch-offs going in different directions. Don’t allow the cable to be pinched in any way - eg garage floor, pull garbage bin over cable - such a simple event may cause a short effectively blocking comms. Damage like that - maybe even during install - leaves no evident witness and could result in an hours/days/weeks long headache to solve. Failure to daisy chain will result in a non working network. Keep the cable twisted as close to the actual terminal as you can - obvious be rational here - don’t drive yourself crazy. On daisy chain terminals ensure both cables are stripped and captured correctly in the terminal. Remember, this is a low voltage protocol, and while miswiring is unlikely to damage hardware as RS485 is usually optocoupled, by the same token, it doesn’t take much of a wiring fault to stop the network As per the next paragraph, don’t forget your resistor at each end of the wiring. There’s some discussion that short runs don’t need resistors. Maybe, maybe not, but at the cost of 1/50th of a cafe coffee or less, its worth including.

The protocol was designed to include a 1/4 watt 120ohm resister at each end of your cable run. This pulls the twisted pair voltage back to 0V between data signals, it stops the signal rebound from the end of the cable run and silences out potential EMC inputs.

Modbus RTU - this is the comms protocol direct from a computer serial port to connected RS485 devices. You will need to specify baud rate, bits, stop bits and parity in your yaml. if your computer does not have a serial port - USB-RS485 serial adapters are readily available. Alternatively - and especially if the device is some distance from your computer you might consider switching to modbus tcp, and install a modbus tcp–>rtu gateway device close to your device. The link to that gateway can be via Wi-Fi if required.

modbus tcp - this is comms over a LAN network (or WAN if you’re tricky). sometimes this will plug into a device, or more frequently you might install a ethernet (or wifi) to RS485 gateway.

RS485 gateway These devices can be configured many ways. i configured mine to accept ethernet - wifi in station mode and convert the modbus tcp to modbus rtu - either serial port or two screw terminals. On the ethernet side of my device i configured a static IP on the home wifi network. static is safest because HA yaml includes that IP. On RS485 side of the configuration webpage you add your RS485 network baud rate, bits, stop bits and parity. you have to have the same settings on every RS485 device on your twisted pair network. My settings were 9600, 8, 1, and no parity. This was common to all the modbus relays, temp sensors AI AO and DI devices. so i adopted that rate for everything.

Programming of your modbus devices. this is where you may go prematurely grey, pull hair out or something even worse. its painstaking, frustrating, one wrong step and you reset the device and start from scratch.

Device ID - this is the “slave number” of your device on the RS485 twisted pair. NOTE the gateway has no setting for this because its number is 0. you can only have one gateway on the network. keep your eyes open. on rare occasions you may have to code that 0 in other device settings. I did not have to do this in yaml. every device obviously must have a different slave address. you can number these between 1 and 254. The addresses can be included in any order on your twisted pair daisy chain. No requirement to be consecutive. You cannot have more than 32 devices on a single twisted pair network - check on your gateway. Some gateways are less than 32 depending upon specs.

FYI - the RS485 portion of the gateway is referred to as the “master”, the ethernet/wifi portion is a “server”, and your computer is of course a “client” of said server.

PREP FOR PROGRAMMING RS485 DEVICES
In preparation, download Modbus Poll. Its free - so long as you dont mind it closing on you every 10 mins. It not an expensive software, and a purchase saves increasing frustration at the 10 minute lockout. Believe me, its probably the most productive spend you will make in a long time. And beyond the initial config, modbus poll can be used to check network operation before the network is handed to HA purvey. (Disclaimer: I am not $ponsored for this or any other recommendation in this how to…!! :smiley: )

Next, regardless of your intended final network, in 99% of cases you WILL need a serial port for initial config. Obtain something suitable - the USB ones are easy to use, attach to your computer to find the COM port number its using (for Windows) Start>Control Panel> Device Manager>expand the section LPT & COM. Could be any number of ports present, but likely yours is a somewhere between COM1 and COM10 inclusive. There should be names beside the COM number - which you should recognize from what you bought. If not see which COM disappears when you disconnect yours.

You need a 2 wire RS485 adapter hand off from your serial with a clear plus or minus to show polarity. connect about 500mm/20" of UTP with the solid colour in positive (+) and the striped-with-white in negative (-). On the other end of the wire strip about 8mm on each core and bend the exposed wire in a tight U shape. this makes an easy to connect wire that can be used over and over to configure your devices.

You got a 4 wire RS485 version? Easily fixed… Check the instructions or google if necessary - “4 wire to 2 wire RS485 conversion”. The fix is usually a jumper wire between 2 terminals. In preparation for your next step, in the two terminals spare, connect about 500mm/20" of UTP with the solid colour in positive (+) and the striped-with-white in negative (-). On the other end of the wire strip about 8mm on each core and bend the exposed wire in a tight U shape. this makes an easy to connect wire that can be used over and over to configure your devices.

Then… Plan your network addresses. record the new addresses handy to each device - you might somehow attach a tag or label so everything you need is available right there - most importantly the new slave number.

Also a good idea to record every device on a spreadsheet. Unique_ID, master, slave addr, manufacturer/model. these as a minimum… remember, 2 years after your setup is complete you wont remember the exact details - well most of us wont remember… Obviously this is even more critical if you are installing as a business!

Get ready the modbus tables for your device. If not in the box, download them. You cant guess these they can be different even within a brand from model to model. Often a google search “[brand] [model number] modbus table download” will find the table quickly - but double check the result was the correct one for your device.

Learning you need to do before you launch into RS485 device configuration
i will cover the 6 normal registers on modbus devices later after this section on programming. You do however need to have a grasp of those principles before

  1. Look in the tables for default address and the default baud rate etc of the device. Note all details.
  2. Look in the table for the change of slave address method and the codes to use. You will need to make the necessary adjustments to the code for the new address in your network
  3. Connect the RS485 terminals on the device to your serial adapter. There are several methods of marking RS485

Whether your twisted pair network connects to a serial port on your computer - or to a gateway, the same RS485 principals apply.

When communicating though, we need to get to the network using the correct method. modbus rtu is straightforward. Choose the correct COM port to use, select modbus rtu as comms, add the baud rate, bits etc. save and connect. your software speaks modbus rtu direct. You will also need to enter the slave number to reach the correct device on the twisted pair network.

modbus tcp is just as easy. input IP address of the gateway, select modbus tcp, add the slave address.

So - you have reached your device on the new network. now you need to configure access.

Im sorry - cant be finished today, but on it. Your comments on direction very appreciated.

1 post - 1 participant

Read full topic

Sending data from external network using rest api

$
0
0

Hi, I’m trying to send temperature from external network(i.e. mobile data) using rest, after i get it working this will be used for python script on another raspberry pi.
I created device in configuration.yaml

sensor:

  • platform: rest
    name: DS18B20_Solution_Temperature
    resource: https://homeassistant_domain.org/api/states/sensor.ds18b20_solution_temperature
    value_template: “{{ value_json.state }}”
    unit_of_measurement: “°C”
    device_class: temperature

Rebooted HA -


To test it I used a postman software with following body:

{
“state”: 23,
“attributes”: {
“unit_of_measurement”: “°C”,
“device_class”: “temperature”,
“friendly_name”: “DS18B20_Solution_Temperature”
}
}

Postman response i got:

{
“entity_id”: “sensor.ds18b20_solution_temperature”,
“state”: “unknown”,
“attributes”: {
“unit_of_measurement”: “°C”,
“device_class”: “temperature”,
“friendly_name”: “DS18B20_Solution_Temperature”
},
“last_changed”: “2025-02-19T06:29:45.830027+00:00”,
“last_reported”: “2025-02-19T06:44:15.930104+00:00”,
“last_updated”: “2025-02-19T06:29:45.830027+00:00”,
“context”: {
“id”: “01JMEEBVQ6T31Y4R2GX873TQSG”,
“parent_id”: null,
“user_id”: null
}
}

Log:

What im doing wrong, please help fix.

1 post - 1 participant

Read full topic

How to restore HA from backup via terminal?

$
0
0

I use HAOS
I can’t do it through the web interface, everything is spinning endlessly and nothing happens, when I reboot the computer with HA, the state is the same as before the attempt to restore.
I have a key installed to encrypt the backup, I only need yaml configs as I understand it is option --folders homeassistant.
I do this

ha backups restore --password YOUR_PASSWORD db725925 --folders homeassistant

in the same way
I get an infinite
Unable to connect to Home Assistant.
Retrying in 45 seconds…

what is wrong ?

PS I don’t mind restoring via the web interface, I just understand that you can try to configure everything more flexibly via the terminal.

UPD I tested the backup after removing encryption and everything works without any problems at all. so the problem is encryption during recovery.

1 post - 1 participant

Read full topic


Nacu Casa Cloud - IPv6 only

$
0
0

Hello!

I would like to run Home Assistant with IPv6 and enable access via Nabu Casa from the Internet.

But as soon as i switch to IPv6, i lose access to the Nabu Casa Cloud Gateway.
My Ubiquiti firewall is configured to allow all traffic from the IOT network to the Internet.
What could be the reason for this? Does Nabu Casa even support IPv6?

Thanks in advance!

1 post - 1 participant

Read full topic

Turn on water heater in the evening on cloudy days

$
0
0

Hello.
I am trying to automate turning on my water heater at the evening only if it was more than 50% cloudy between 10am and 3pm on that day.

I want to specifically check for these times as these are the times my water heater panels get sun.

What’s the best way to achieve this ?

P.S. I tried asking Gemini, it gave me some options that didn’t work but the problem with LLMs is that HA is moving too fast for them and things are changing so their answers are based on outdated information (due to the cutoff). If I have the right direction, I can direct it to provide me a good answer.

Thank you

1 post - 1 participant

Read full topic

Template Error Sensor in configuration.yaml

$
0
0

Hello,

first of all, I am quite new and created the code with the help of AI. Unfortunately, I always get the following error messages, no matter what I correct in the code:

Error 1:

Logger: homeassistant.helpers.event
Quelle: helpers/template.py:645
Erstmals aufgetreten: 09:27:10 (1 Vorkommnisse)
Zuletzt protokolliert: 09:27:10

Error while processing template: Template<template=({% if states('sensor.solax_grid_import')|float > 0 %} {{ states('sensor.solax_grid_import')|float }} {% elif states('sensor.solax_grid_export')|float > 0 %} {{ -1 * states('sensor.solax_grid_export')|float }} {% else %} 0 {% endif %}) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2375, in forgiving_float_filter
    return float(value)
ValueError: could not convert string to float: 'unavailable'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 643, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2756, in _render_with_context
    return template.render(**kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2378, in forgiving_float_filter
    raise_no_default("float", value)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1932, in raise_no_default
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% if states('sensor.solax_grid_import')|float > 0 %}
            {{ states('sensor.solax_grid_import')|float }}
          {% elif states('sensor.solax_grid_export')|float > 0 %}
            {{ -1 * states('sensor.solax_grid_export')|float }}
          {% else %}
            0
          {% endif %}' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 760, in async_render_to_info
    render_info._result = self.async_render(  # noqa: SLF001
                          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
        variables, strict=strict, log_fn=log_fn, **kwargs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 645, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% if states('sensor.solax_grid_import')|float > 0 %}
            {{ states('sensor.solax_grid_import')|float }}
          {% elif states('sensor.solax_grid_export')|float > 0 %}
            {{ -1 * states('sensor.solax_grid_export')|float }}
          {% else %}
            0
          {% endif %}' but no default was specified

Error 2

Logger: homeassistant.components.template.template_entity
Quelle: components/template/template_entity.py:203
Integration: Template (Dokumentation, Probleme)
Erstmals aufgetreten: 09:27:10 (1 Vorkommnisse)
Zuletzt protokolliert: 09:27:10

TemplateError('ValueError: Template error: float got invalid input 'unavailable' when rendering template '{% if states('sensor.solax_grid_import')|float > 0 %} {{ states('sensor.solax_grid_import')|float }} {% elif states('sensor.solax_grid_export')|float > 0 %} {{ -1 * states('sensor.solax_grid_export')|float }} {% else %} 0 {% endif %}' but no default was specified') while processing template 'Template<template=({% if states('sensor.solax_grid_import')|float > 0 %} {{ states('sensor.solax_grid_import')|float }} {% elif states('sensor.solax_grid_export')|float > 0 %} {{ -1 * states('sensor.solax_grid_export')|float }} {% else %} 0 {% endif %}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.stromfluss'

Here is the Part of configuration.yaml

      - name: "Haus Stromverbrauch"
        unique_id: haus_stromverbrauch
        unit_of_measurement: "W"
        state_class: measurement
        device_class: power
        state: >-
          {% set pv = states('sensor.pv_power_total') | float(0) %}
          {% set netz_export = states('sensor.solax_grid_export') %}
          {% set netz_import = states('sensor.solax_grid_import') %}
          {% set batterie = states('sensor.solax_battery_power_charge') %}

          {% set netz_export = netz_export | float(0) if netz_export not in ['unavailable', 'unknown', None] else 0 %}
          {% set netz_import = netz_import | float(0) if netz_import not in ['unavailable', 'unknown', None] else 0 %}
          {% set batterie = batterie | float(0) if batterie not in ['unavailable', 'unknown', None] else 0 %}

          {% set batterie_korrigiert = batterie if batterie < 0 else batterie * -1 %}

          {{ pv - netz_export + netz_import + batterie_korrigiert }}

Basically, the code works and also calculates the correct value.

However, I would like the error to no longer be displayed under logs.

5 posts - 2 participants

Read full topic

Remote control via duckdns suddenly stop works

$
0
0

Hi all gentlemens,
I checked this community with similar topic, but I didnt find out answer for my issue, or I dont understand whats going on (sorry, but please help me).
I use remote acces via duckdns , but one week later I lost connection suddenly and until now i am not able to connect to HA anymore.
I did nothink with update or kind of like this. What I have done:

  • chceck connection status
  • rescan wifi and again connect to my network by CLI commands
  • turn on/off HW
  • again check connection to my home network

How / what i should follow any steps to solve my issue? Can someone advise me , please?

1 post - 1 participant

Read full topic

Fault tolerance for web rtc cards

$
0
0

Hi Community,

I am wondering if there is a way I can build in fault tolerance for my web rtc cards?

I am using a thinclient to run two displays, one with general stuff, and the other with 6 low quality camera streams. They work great, albeit low frame rate but that doesn’t matter.

The problem is, occasionally, one or more streams will drop out and show the loading symbol. A refresh of the page fixes the streams, but I am hoping to have someway to reload that card or the stream if it freezes up.

Any ideas?

I guess I could somehow just have the whole page refresh every 30 mins or so if it comes to it, but I’d like to avoid that.

I am displaying the page using firefox on Ubuntu based Linux.

1 post - 1 participant

Read full topic

Viewing all 106291 articles
Browse latest View live


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