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

Auto Discovery Home Assistant #616

Closed
RoSulek1 opened this issue Mar 2, 2018 · 5 comments
Closed

Auto Discovery Home Assistant #616

RoSulek1 opened this issue Mar 2, 2018 · 5 comments
Assignees
Milestone

Comments

@RoSulek1
Copy link

RoSulek1 commented Mar 2, 2018

Hi at all
Sonoff Basic in Pulse Switch Mode
Integration with HomeAssistant -> ON

All working fine with auto discovery mode, but i cannot find the configuration of this Sonoff in configuration.yaml
I would like to modify the configuration by myself, to create switch in configuration.yaml working in pulse mode.

Where i can find this configuration in HA?

@xoseperez
Copy link
Owner

The documentation in HA is misleading here. It says " The basic idea is that the device itself adds its configuration into your configuration.yaml automatically" (https://home-assistant.io/components/discovery/) but it does not.

As a developer states here "The discovery component does not add discovered devices to your configuration.yaml file, it only makes them available in the UI without the need of any configuration. ", same issue at the bottom: "We are not going to have discovery write to the configuration.yaml file."

@mcspr
Copy link
Collaborator

mcspr commented Mar 2, 2018

@RoSulek1 Autodiscovery works via mqtt too and you can easily listen to the its traffic via mosquitto_sub

In configuration.yaml

mqtt:
  discovery: true
  ... rest of mqtt config...
$ mosquitto_sub -h <mqtt_host> -u <mqtt_user> -P <mqtt_pass> -t homeassistant/# -v
homeassistant/switch/ESPURNA_8E0067_0/config {"name":"ESPURNA_8E0067","platform":"mqtt","state_topic":"home/ESPURNA_8E0067/relay/0","command_topic":"home/ESPURNA_8E0067/relay/0/set","payload_on":"1","payload_off":"0","availability_topic":"home/ESPURNA_8E0067/status","payload_available":"1","payload_not_available":"0"}

json keys are directly mapped on switch.mqtt, so you could even write some script to grab this data and output yaml configuration. (!include switch.yaml inside switch domain, or directly just generate whole configuration.yaml)

@xoseperez
Copy link
Owner

Commit 207f58f adds a button to the web UI that displays the required settings for the device in Home Assistant. So now you will have two ways to register your device, automatically using MQTT Discovery feature or copy-pasting the settings right into your configuration.yml file.

@xoseperez xoseperez self-assigned this Mar 2, 2018
@xoseperez xoseperez added this to the 1.12.4 milestone Mar 2, 2018
@xoseperez
Copy link
Owner

Staged for release

@RoSulek1
Copy link
Author

RoSulek1 commented Mar 3, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants