- Platform information:
- Hardware: RPi 3
- OS: OpenHabian
- Java Runtime Environment: Zulu 11
- openHAB version: 3.3.0
TLDR: How can I set Things configurations from Item values?
Hi all! I’ve been playing around with several ESP32 and ESP8266 devices and having a blast (first openHAB experience, even though I’m reading material for years now).
Last thing I started playing with was the ESP32-CAM with Tasmota. I added some channels for getting the IP and stream/snapshot URLs using INFO2 topic and incoming value transformations, but then it didn’t work over the cloud because it only supports traffic to the server.
Then I installed the IP Camera Binding and created a Camera Thing. It worked at first try and I could see the stream over the cloud using oh-image-card widget on a custom widget.
The issue is my cameras may change the IP address from now and then (yes, I know I can assign an static IP), so I was wondering if it was possible to use item values on Things configuration fields, like I do on widgets:
Widget:
- component: oh-image-card
config:
action: photos
actionPhotoBrowserConfig:
lazy: true
theme: dark
type: popup
actionPhotos: =[items[props.video].state]
lazy: true
style:
border-radius: 6px
margin: 0px
width: 100%
url: =items[props.snapshot].state
IP Camera Thing:
UID: ipcamera:generic:ip_camera_1
label: IP Camera 1
thingTypeUID: ipcamera:generic
configuration:
mjpegOptions: -q:v 5 -r 2 -vf scale=640:-2 -update 1
ipAddress: 192.168.1.128
mjpegUrl: http://192.168.1.128:81/stream
updateImageWhen: "0"
gifPreroll: 0
ffmpegLocation: /usr/bin/ffmpeg
ipWhitelist: DISABLE
mp4OutOptions: -c:v copy -c:a copy
pollTime: 1000
port: 80
snapshotUrl: http://192.168.1.128/snapshot.jpg
snapshotOptions: -an -vsync vfr -q:v 2 -update 1
hlsOutOptions: -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4
gifOutOptions: -r 2 -filter_complex scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse
ffmpegInput: http://192.168.1.128:81/stream
Thanks!!