Davall
(Matthew)
1
Hi
I am trying to change part of the modbus configuration, specifically the IP address, with an automation - triggered when the input_text.IP changes
I have the below but I cannot seem to get it to work. Is there a different service call that I should be using?
TIA
description: ""
mode: single
trigger:
platform: state
entity_id: input_text.victron_ip
action:
- service: replace
data:
path: /config/modbus2.yaml
pattern: 'host: .*'
repl: 'host: "{{ states('input_text.victron_ip') }}"'
count: 1
flags: 'm'
start: 50
Tinkerer
(aka DubhAd on GitHub)
2
Where did you get the replace
service from?
Davall
(Matthew)
3
I have to admit I was stuck and came across it on google somewhere. But I dont think it is real…
Davall
(Matthew)
5
OK thanks. Is there a way to do what I am looking for though?
Tinkerer
(aka DubhAd on GitHub)
6
There’s no official solution I know of, and no custom components I’m aware of either.
Davall
(Matthew)
7
OK ty. I was hoping for something simple where I could write a new version of the entire file with a couple of variables from the UI
host: {{ states(‘input_text.victron_ip’) }}
port: {{ states(‘input_text.victron_port’) }}
name: Modbus_name
etc etc