-
Notifications
You must be signed in to change notification settings - Fork 14
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
emeter output is not usable #10
Comments
Of course, @gck303 ! Pushing changes soon. :) |
flavio-fernandes
pushed a commit
that referenced
this issue
Oct 21, 2023
Values of emeter are also published individually. Example: /dehumidifier/switch/emeter : <EmeterStatus power=3.14 voltage=122.049119 current=0.1256 total=51.493> /dehumidifier/switch/emeter/power : 3.14 <-- new /dehumidifier/switch/emeter/voltage : 122.049119 <-- new /dehumidifier/switch/emeter/current : 0.1256 <-- new /dehumidifier/switch/emeter/total : 51.493 <-- new Fixes: #10 Signed-off-by: Flavio Fernandes <flavio@flaviof.com>
flavio-fernandes
added a commit
that referenced
this issue
Oct 21, 2023
Values of emeter are also published individually. Example: /dehumidifier/switch/emeter : <EmeterStatus power=3.14 voltage=122.049119 current=0.1256 total=51.493> /dehumidifier/switch/emeter/power : 3.14 <-- new /dehumidifier/switch/emeter/voltage : 122.049119 <-- new /dehumidifier/switch/emeter/current : 0.1256 <-- new /dehumidifier/switch/emeter/total : 51.493 <-- new Fixes: #10 Signed-off-by: Flavio Fernandes <flavio@flaviof.com> Co-authored-by: Your Name <you@example.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have tried to use the emeter output, but it has a couple of issues:
I have edited the code to remove the <> send multiple messages. Can this be incorporated in the standard code?
`async def handle_emeter_event_kasa(
kasa_emeter: KasaEmeterEvent, run_state: RunState, mqtt_send_q: asyncio.Queue
):
kasa = run_state.kasas.get(kasa_emeter.name)
if not kasa:
logger.warning(
f"Unable to find device with name {kasa_emeter.name}. Ignoring kasa emeter event"
)
return
topic = f"{kasa.topic}/emeter"
payload = kasa_emeter.emeter_status
payload = payload.replace('<', '')
payload = payload.replace('>', '')
logger.info(
f"Kasa emeter event requesting mqtt for {kasa_emeter.name} to publish"
f" {topic} as {payload}"
)
await mqtt_send_q.put(MqttMsgEvent(topic=topic, payload=payload))
`
The text was updated successfully, but these errors were encountered: