Hi,
Using a bare Hassio Pi3 with Mosquitto as a broker I have my main 2nd setup read that and create mqtt sensors. (Had the Mosquitto broker in my main setup before, but since that is a rather processor intense system, I decided to split them and it works really nice.)
Which made me wonder if I could do something alike with the now disabled bluetooth in my setup. Bluetooth caused all kinds of timing issues, so I disabled it from the main setup.
Could I enable it on the bare system, and create mqtt sensors on the main setup reading the bare systems bluetooth sensors?
Please help me in setting this up?
In fact it should not be much of a big setup, it’s only about 6 devices I’d like to track, and the odd BT tracker of passersby.
If at all possible I’d like it to be an automatic setup a la @NotoriousBDG 's Howto create battery alert without creating a template for every device
as an example I have these sensors on the main system
sensor:
- platform: mqtt
name: Activity selection
state_topic: 'activity_selection'
and feeding automation action on the bare system setup:
- service: mqtt.publish
data_template:
topic: 'activity_selection'
retain: true
payload: >
{{ states('input_select.activity') }}
Not sure how to do this with a bluetooth sensor though…
- alias: 'device 1 BT sensor'
id: 'device 1 BT sensor'
trigger:
platform: state
entity_id: sensor.device1_bt
condition:
condition: template
value_template: >
{{ states('sensor.device1_bt') in
['home','not_home'] }}
action:
- service: mqtt.publish
data_template:
topic: 'device_1_bt_state'
retain: true
payload: >
{{ states('sensor.device1_bt') }} # or trigger.to_state.state ?
and then a sensor on the second main system:
sensor:
- platform: mqtt
name: Device 1 Bt
state_topic: 'device_1_bt_state'
or would I need:
device_tracker:
- platform: mqtt_json
devices:
device1_bt: device_1_bt_state
would this work?
that for your insights