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

[Question] Is it possible to Transmit 433Mhz code recieved from MQTT command ? #22

Closed
animavitis opened this issue Oct 7, 2018 · 9 comments

Comments

@animavitis
Copy link

Hi

Is it possible to send MQTT command to esphomeyaml device with code that should be then send via Remote Transmitter Component?? ie.:

From my Home assistant i want to send something like that:

        topic: "esphomeyaml/rftransmit/command"
        payload: "{"rc_switch_raw":{"code":"001010011001111101011011","protocol":"1"}}"

then i want esphomeyaml to send automatically this as RF code (without define this code as Switch in eshomeyaml config file).

Any idea how to do this??

@OttoWinter
Copy link
Member

No, that's currently not possible. The reason is mostly because the logic that "converts" the string representation of the code (001010011001111101011011) into the actual stuff sent happens in esphomeyaml on your PC. Having the same implementation a second time in esphomelib in another programming language would be a maintaining nightmare.

Maybe in the future, but until that can happen esphomelib would need to get a whole event bus to communicate between components which will be fun to implement :)

@rradar
Copy link

rradar commented Oct 23, 2018

Give a look to OpenMQTTGateway (OMG!) for now 😄

https://github.com/1technophile/OpenMQTTGateway

Probably exactly what are you looking for (also works for infrared and in both directions)!

@animavitis
Copy link
Author

i was using it some time ago & it was working great, but i love esphomeyaml for its simplicity

@OttoWinter OttoWinter transferred this issue from esphome/esphome Feb 2, 2019
@OttoWinter OttoWinter added this to the 1.11.0 milestone Feb 9, 2019
@OttoWinter OttoWinter added this to To do in ESPHome Feb 9, 2019
@OttoWinter OttoWinter moved this from To do to Future in ESPHome Feb 10, 2019
@dlashua
Copy link

dlashua commented Mar 6, 2019

even a sensor.remote_receiver component that just sent the raw data would be useful. Getting something like:

[4088, -1542, 1019, -510, 513, -1019, 510, -509, 511, -510, 1020,
          -1020, 1022, -1019, 510, -509, 511, -510, 511, -509, 511, -510,
          1020, -1019, 510, -511, 1020, -510, 512, -508, 510, -1020, 1022,
          -1021, 1019, -1019, 511, -510, 510, -510, 1022, -1020, 1019,
          -1020, 511, -511, 1018, -1022, 1020, -1019, 1021, -1019, 1020,
          -511, 510, -1019, 1023, -1019, 1019, -510, 512, -508, 510, -511,
          512, -1019, 510, -509]

in HomeAssistant seems pretty nasty, but something could convert it on the HA end to a more manageable string to perform automations with.

The alternative, at the moment, is to flash a "dumping" firmware to the ESP device. Trigger the sending device. Get the dump code. Add that code to the ESPHome YAML. Then reflash the ESP device. And while this process certainly provides the cleanest end result (a entity in HASS for every code handled in exactly the way that code should be handled) it's quite tedious for tinkerers.

@OttoWinter
Copy link
Member

OttoWinter commented Mar 6, 2019

ESPHome can dump these codes too you know - see remote_receiver

@dlashua
Copy link

dlashua commented Mar 15, 2019

Yes, but ESPHome dumps them to the log. (per https://esphome.io/components/switch/remote_transmitter.html#finding-remote-codes). This means, that to add a new 433Mhz code, I have to view the log for the ESPHome device, trigger the 433Mhz, look for the code, add the code to the YAML for the ESPHome device, recompile the code, and upload again.

Having this data visible in a text_sensor would mean I could act on it in Home Assistant or via MQTT without having to recompile for every new 433Mhz device I add.

@OttoWinter
Copy link
Member

@dlashua All of those actions are not a ton of work, especially when you batch the operation. So for example set up esphome to dump everything, then press all buttons and record the data, while adding it to the YAML. I've done it before and it's not much work. Besides, I doubt it would be any quicker through HA because you would still need to copy-paste it.

And then there's the fact that recompiling is not that slow when you don't add/remove a component.

I can tell you that due to technical reasons what you're asking is impossible. Text Sensor strings have a limited length because of how the TCP stack on these ESPs works - that's also why the raw messages are split into multiple lines in the logs.

@dlashua
Copy link

dlashua commented Mar 15, 2019 via email

@OttoWinter
Copy link
Member

Ok, with 1.13 this will be possible - all remote transmits are now "actions", with templatable values.

ESPHome automation moved this from Future to Done May 27, 2019
@esphome esphome locked and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
ESPHome
  
Done
Development

No branches or pull requests

4 participants