Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combine mqtt json #924

Closed
tarbax opened this issue Dec 25, 2019 · 1 comment
Closed

combine mqtt json #924

tarbax opened this issue Dec 25, 2019 · 1 comment

Comments

@tarbax
Copy link

tarbax commented Dec 25, 2019

i have lots of BRUH multisensors that needs to be upgraded to connect to a new mqtt broker (ip changed due vlan config)
but i have many many integrations and automations so i want to get same json format on esphome.

been trying for few weeks. is this possible ? and how ?

what the original code gives:
topic: bruh/sensornode3
{"state":"OFF","color":{"r":255,"g":126,"b":0},"brightness":100,"motion":"standby","ldr":"74","humidity":"55.70","temperature":"19.60","heatIndex":"13.88"}
set topic: bruh/sensornode3/set

my config:

esphome:
  name: sensornode3
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "hidden"
  password: "hidden"

web_server:
  port: 80

mqtt:
  broker: 10.0.1.202
  port: 1883
  username: hidden
  password: hidden
availability:
  topic:  bruh/sensornode3/status
  payload_available: online
  payload_not_available: offline
state_topic:  bruh/sensornode3
command_topic:  bruh/sensornode3/set

api:
  password: 'hidden'

ota:
  password: 'hidden'

sensor:
  - platform: dht
    pin: D7
    temperature:
      name: "sn3 Temperature"
    humidity:
      name: "sn3 Humidity"
  - platform: adc
    pin: A0
    name: "sn3 Brightness"
    unit_of_measurement: lux
    filters:
      - lambda: |-
          return (x / 10000.0) * 2000000.0;

binary_sensor:
  - platform: gpio
    pin: D5
    name: "sn3 pir"
    device_class: motion

output:
  - platform: esp8266_pwm
    pin: D1
    id: redgpio
  - platform: esp8266_pwm
    pin: D2
    id: greengpio
  - platform: esp8266_pwm
    pin: D3
    id: bluegpio

light:
  - platform: rgb
    name: "sn3 led"
    red: redgpio
    green: greengpio
    blue: bluegpio
@close-issue-app
Copy link

#430

@lock lock bot locked and limited conversation to collaborators Jan 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant