Giter Site home page Giter Site logo

octoprint-tasmotamqtt's Introduction

OctoPrint-TasmotaMQTT

This plugin allows the control of Tasmota devices from within OctoPrint via MQTT commands.

Prerequisites

Install the MQTT plugin via the Plugin Manager or manually using this url:

https://github.com/OctoPrint/OctoPrint-MQTT/archive/master.zip

Setup

Install via the Plugin Manager or manually using this URL:

https://github.com/jneilliii/OctoPrint-TasmotaMQTT/archive/master.zip

Configuration

  • Once installed you need to configure the "Full Topic" EXACTLY the same way like in your Tasmota devices. It can be found at the Tasmota device web-service page under information. Copy it over to make sure it is identical. E.g., %topic%/%prefix%/
  • add a Relay device and configure
  • Topic: is the name of the Tasmota device
  • Relay #: For multiple relay devices enter the index number that matches your desired relay. For single relay devices like the iTead Sonoff S20 Smart Socket, leave it blank.
  • Icon class: lets you select the icon to be shown on the front page.
  • Warning Prompt: Issues always an addtional warning to avoid accidentally switching.
  • Warn While Printing: Issues an addtional warning only if a print is in progress.
  • Auto Connect: Connect to the printer N seconds after power was switched on. The time delays can help to establish a stable connection.
  • Auto Disconnect: Disconnects the printer N seconds prior of switching off the power.
  • GCODE Trigger: Enable the switching via M80 and M81 code. See below.
  • GCODE On Delay: Time delay in seconds after receiving M80 before switching on.
  • GCODE Off Delay: Time delay in seconds after receving M81 before switching off.
  • Run System Command After On: Issue a system command after switching on.
  • Run System Command Before Off: Issue a system command after switching off.

GCODE config

If GCODE Trigger is switched on, the plugin looks out for Gcode to switch the relay on resp. off. This can be used to switch the printer on at the start of a print and off right after a print is finished. The delay times can be used to e.g. to let the printer powered on for a certain time after the print is finished e.g. to let fans running helping to cool down quicker.

The usual format of the GCODE which performs the trigger of the relay is:

M80|M81 TOPIC RELAY#

Explanation:

  • M80 -- Switch on
  • M81 -- Switch off
  • TOPIC: Name of the device to be switched (same as in the Tasmota device)
  • RELAY#: Number of the relay to be switched. Leave it empty for single relay units.

This can be included either in the slicer settings to be added in front resp. at the end of a gcode file. Or in Octoprint itself, under Settings->Printer->GCODE scripts in the fields Before print job starts and After print job completes.

Examples:

  • M80 sonoff_printer To turn a single-relay Tasmota unit named "sonoff_printer" on.
  • M81 4chpro_printer 1 Turn off relay number 1 of a multiple relay Tasmota device named "4chpro_printer".

Screenshots

screenshot

screenshot

screenshot

Most recent changelog

0.3.8 (11/22/2020)

Added

  • startup event monitoring
  • upload event monitoring if print is flagged to start automatically
  • new access control permissions to replace deprecated user_permission
  • idle timer reset/restart if relay is powered on outside of OctoPrint
  • release channels for OctoPrint 1.5.0+ for future rc testing, similar to OctoPrint as described here

Updated

  • knockout sortable library for OctoPrint 1.5.0 compatibility

Fixed

  • issues with startup and idle timer

Get Help

If you experience issues with this plugin or need assistance please use the issue tracker by clicking issues above.

Additional Plugins

Check out my other plugins here

Sponsors

Support My Efforts

I, jneilliii, programmed this plugin for fun and do my best effort to support those that have issues with it, please return the favor and leave me a tip or become a Patron if you find this plugin helpful and want me to continue future development.

Patreon paypal

No paypal.me? Send funds via PayPal to [email protected]

octoprint-tasmotamqtt's People

Contributors

fieldofview avatar giloser avatar jneilliii avatar torwag avatar vogler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

octoprint-tasmotamqtt's Issues

Can't use M80 and a parameter with Reptier

Hey

I just set up a new Tasmota Sonoff basic.
the plugin turns it on and off then hititng the lightning bolt (had to change the topic/prefix order like one of the other peopel wrote)

I want to turn the printer on when the print starts and turn it off when the print ends (with a small delay).

I've noticed the following:
If I add a M80 /81 command with no parameters the plugin won't start the sonoff
if I add a M80/81 with the sonoff's topic name - my printer (Micromake) doesn't like it and asks Octoprint to resent. this causes a communication error. from the terminal:
this goes in a loop:
Recv: skip 3832
Recv: ok
Recv:
Recv: Resend:3823
Recv: ok
Send: N3823 M81 SonoffSousVide*57
Recv: skip 0

would it be possible to either:

  1. have an option to turn on and off the sonoff when the print start/ends regardless of gcode
  2. turn on and off - with M80/81 with no paramters.

Thanks

Feature Request: configured MQTT topic

MQTT topic is hardcoded as %topic%/%prefix%/

It is possible to add configuration setting to use custom topic? For example I use: switches/%prefix%/%topic%/. I changed it in local code, because my all other "SmartHome" solutions using this topic format.

Ability to change "StateText-s"

Hello.
I use others StateText1 - 0 and StateText2 - 1. this needed for my Home-Auto.
In this plugin used default OFF and OFF. It will be very useful to change this from settigs..
or please take an advice where should i change in code?

M81 Command Prior To Print Causes Ender3 to Shutdown

I've got a fan on a sonoff relay (topic printerfan01) and GCODE triggers enabled on the octoprint module.

As part of my start GCODE, I issue M81 printerfan01 to ensure the fan is shutdown. This causes the ender3 to display "Ender3 Poweroff", steppers shutdown and bed/end set themselves to 0 degrees prior to bed levelling.

Aware M81 is the Marlin PowerOff code, but M81 should not be passed through if GCODE triggering is enabled?

Works great - a couple of suggestions

I had to change the full topic to %topic%/%prefix%/ from the default (%prefix%/%topic%/) for it to work. Might make sense to change this in the code so that the default works.

Can you also enable the auto-connect and disconnect (similar to the OctoPrint-Tasmota plugin).
Thanks.

Sonoff POW

Hello,

I am using a Sonoff POW with Tasmota installed. I cant get this work this with this sonoff. From your configuration suggestions, what should I use as a topic in the tasmota webui configuration ? For example: switchname/1/ or the actual string "%topic%/%prefix%/" ? Also if there some debug log I can view ? I know that the MQTT plugin works in my octopi because I can see the messages of starting and stopping a print, coming into Node-RED.

Have you tried to use this plugin with a Sonoff POW ? Does it require any special config ? Relay, index or something else perhaps ?

Clarification on topic

Is this expected behaviour or a possible bug?
When sonoff 4Ch Pro (6.6.0) and mqtt plugin are configured with %topic%/%prefix%/ the updating of the icon/

When both are configured with %prefix%/%topic%/
-the icon revolves constantly and doesn't update

  • the switch doens't work as it's still trying to toggle to the last state

I presume this is why you say:
Once installed your Tasmota devices will need to have the FullTopic configured as %topic%/%prefix%/

but then you also give a place to change this and say
Full Topic in plugin settings must match your relay's Full Topic pattern.

So should this full topic section in the plugin allow %prefix%/%topic%/ please?
I've too many devices working with this to change this round to suit the plugin sadly.

Mostly thanks for making this

Invert Relay for Normally Closed SONOFF Relay

Awesome plug-in, great replacement for PSU Control when I moved from using a GPIO connected Relay on my PI to a SONOFF 4CH Pro.

Would it be possible to add an "Invert Relay" feature to your Relay Editor configuration settings? Basically ON would mean OFF and OFF would mean ON for that relay..

I used a "Normally Closed" relay setup on all my 3DPrinters. That way if the SONOFF were to lose power during a print, the mains source would continue to power the printer as the relay remains closed. I then Open or set to "ON" the relay via MQTT to turn OFF the printer.

I know everyone will tell me to set the SONOFF to "BASIC" and manually configure the Relay GPIO pin to invert for "Normally Closed" but then you lose all the great features/benefits of the SONOFF configuration.

I manually edited the case statement in your .js file and swapped the ON/OFF in the .css file. Now the plugin interprets ON/OFF swapped. Of course, this affects any relay configure in the plug-in versus any one specific relay. It would be great if this could be configure for a specific relay; that way you could have other relays in the plug-in that maintain their normal ON/OFF for a Normally Open relay setting. For example, if you had another relay that drove LED lights attached to your 3D Printer.

I would be very happy to test a branch if you have interested in pursuing the feature.

Keep up the great work.

Request: possibility to cancel switch off

Would it be possible to cancel the switching off when the GCODE triggered off delay is enabled?
I use this feature to switch off my printer after the print has finished when I am not around.
But when I am near my printer, I would like to be able to cancel the switching off.
So could an interface be added to be able to cancel the switching off?
Maybe through a pop-up, or by flashing the icon during the off delay and clicking it to cancel?

Autoconnect fails if already connected

Not totally sure, but it seems the autoconnect function leads to an error if the printer is connected already.
If I print something and connect to the printer before (otherwise one can not send a print-job). The print jobs starts (bed starts heating) but finally an octoprint issues an error that and the print is interrupted. In the terminal the following will be reported:


Changing monitoring state from "Printing" to "Offline"
Changing monitoring state from "Offline" to "Detecting serial port"
Serial port list: ['/dev/ttyUSB0']
Connecting to: /dev/ttyUSB0
Changing monitoring state from "Detecting serial port" to "Error: Connection error, see Terminal tab"
Unexpected error while connecting to serial port: None SerialException: '[Errno 11] Could not exclusively lock port /dev/ttyUSB0: [Errno 11] Resource temporarily unavailable' @ comm.py:_openSerial:2661 (hook default)
Connection closed, closing down monitor

If autoprint is switched off, it works correct.
I believe we have a challenge here with how to the device get switched on. If switched on manually (pressing the icon) it makes sens to perform the autoconnect. However, if switched on via GCODE, the printer will be on already. I try to verfify this behaviour in the code and see if it really tries to issue a connection starting from GCODE.

My plug with tasmota won´t work with this plugin

Hello,

i have a problem. I own a plug Sonoff S20 and it´s flashed with the actual tasmota firmware. My MQTT-Config:

MQTT

Info

Now i installed the "MQTT"-Plugin and the "OctoPrint-TasmotaMQTT"-Plugin. The "MQTT"-Plugin i have only added the Host IP-Adress, the other parameters are default.

In the "OctoPrint-TasmotaMQTT"-Plugin i've tried all the settings, none of them work here, neither for switching nor for feedback.

Can anyone help me what i have to configure?

Greetings and thanks, Markus

icon keeps rotating with changed 'full topic'

Hello
The plugin is working very reliable, thank you.
Now I change the topic-path of my tasmotas with an aditional 'tasmota/' at the front.
So the full topic path changes to 'tasmota/%prefix%/%topic%/'
Here comes the problem: Switching the tasmota on by clicking on the power icon is working, but the power icon does not stop rotating and switching off is not possible.
Any idea?
Greetings Klaus

Improve documentation alittle

I just installed this plugin and I think I will like it.

But I would like some more explanations for each setting.
e.g. in a table in the README or with tool tips inside the website.

  • What do Auto Connect and Auto Disconnect mean?
  • What units are the Delays? (seconds I guess)

Plugin can't detect power state of tasmota

Could you please shed some light on how exactly do you detect power state of the Tasmota?

I am running Sonoff basic with Tasmota 5.12 and while I tried setting both "%topic%/%prefix%/" and "%prefix%/%topic%/" in my Tasmota and in the plugin, it can't detect the power state of it.

Now it says my Tasmota is ON and it is sending "OFF" command no matter in which state the Tasmota currently is.
Is there anything I have to configure in Tasmota to make it work with this plugin?
Using MQTT.fx I can see that the device correctly reports it's state on stat/%topic%/POWER in plain text and stat/%topic%/RESULT in json.

auto discovery ?

tasmota devices will publish their capabilities on start

1575375915: New client connected from 192.168.xx.xx as DVES_AAAAAA (p2, c1, k30, u'sonoff').
1575375915: Will message specified (7 bytes) (r1, q1).
1575375915:     tele/sonoff/LWT
1575375915: Sending CONNACK to DVES_AAAAAA (0, 0)
1575375915: Received PUBLISH from DVES_AAAAAA (d0, q0, r1, m0, 'tele/sonoff/LWT', ... (6 bytes))
1575375915: Received PUBLISH from DVES_AAAAAA (d0, q0, r0, m0, 'cmnd/sonoff/POWER', ... (0 bytes))
1575375915: Received SUBSCRIBE from DVES_AAAAAA
1575375915:     cmnd/sonoff/# (QoS 0)
1575375915: DVES_AAAAAA 0 cmnd/sonoff/#
1575375915: Sending SUBACK to DVES_AAAAAA
1575375915: Received SUBSCRIBE from DVES_AAAAAA
1575375915:     cmnd/sonoffs/# (QoS 0)
1575375915: DVES_AAAAAA 0 cmnd/sonoffs/#
1575375915: Sending SUBACK to DVES_AAAAAA
1575375915: Received SUBSCRIBE from DVES_AAAAAA
1575375915:     cmnd/DVES_AAAAAA_fb/# (QoS 0)
1575375915: DVES_AAAAAA 0 cmnd/DVES_AAAAAA_fb/#
1575375915: Sending SUBACK to DVES_AAAAAA
1575375915: Received PUBLISH from DVES_AAAAAA (d0, q0, r0, m0, 'tele/sonoff/INFO1', ... (111 bytes))
1575375916: Received PUBLISH from DVES_AAAAAA (d0, q0, r0, m0, 'tele/sonoff/INFO2', ... (79 bytes))
1575375916: Received PUBLISH from DVES_AAAAAA (d0, q0, r0, m0, 'tele/sonoff/INFO3', ... (43 bytes))
1575375916: Received PUBLISH from DVES_AAAAAA (d0, q0, r0, m0, 'stat/sonoff/RESULT', ... (14 bytes))
1575375916: Received PUBLISH from DVES_AAAAAA (d0, q0, r1, m0, 'stat/sonoff/POWER', ... (2 bytes))
1575375925: Received PUBLISH from DVES_AAAAAA (d0, q0, r0, m0, 'tele/sonoff/STATE', ... (291 bytes))

I believe it should be possible to subscribe and fetch all these and show all available switches/sockets :)

Doesn't gracefully disconnect before GCODE off

I've started putting the M81 in my finishing GCODE for my prints and it works a treat. Unfortunately, despite being told to auto disconnect before turning off the printer, it doesn't.

I think this might be interacting poorly with the Pushover plugin, which I've configured to send me a notification when a print job is complete.

Switch turns on but icon keeps spinning (new ON state not recognised)

I'm using a Tasmotised S26 GPO switch.
Running 9.2 Tasmota
Clicking the power icon in the toolbar works.
It sends this MQTT:

cmnd/Creality_3D_Printer_Power/POWER ON

Then this response comes from the S26:

stat/Creality_3D_Printer_Power/RESULT {"POWER":"ON"}
stat/Creality_3D_Printer_Power/POWER ON 

But the icon stays red and spins - seems the plugin isn't seeing the confirmation of the ON status...

Config page is:


Screen Shot 2021-03-05 at 2 09 45 pm


Relay config is:


Screen Shot 2021-03-05 at 2 09 14 pm


Any help appreciated.
Thanks,
CableTie

Shut-down clock triggered upon start-up

i use your addin here to shut down both the PI and the printer after heater cool and a delay. Works awesome that way.
However, when I turn the switch back on (from external means as the pi is off) it starts up in the shut-off mode timer and (set to 3 minutes warning). I have this set time to get the console open and cancel the shutdown before tasmotamqtt shuts the switch off again. Can there be a setting, or is there a setting i am not understanding that recognizes that the PI has just powered up and the shutdown timer should be restarted at 0, not causing the software to be started up in shutdown mode?

Not getting power state on relay 1 of multichannel sonoff

Weird one for you and I'll do some more debugging tomorrow but on the same device

  • Setting the relay to 4 works fine
    [2021-07-06 18:19:24,064] DEBUG: Received message for stat/tvarea/POWER4: b'ON'
    [2021-07-06 18:19:31,798] DEBUG: turning off tvarea relay 4
    [2021-07-06 18:19:32,057] DEBUG: Received message for stat/tvarea/POWER4: b'OFF'

Changing nothing else but setting it to one and the icon spins red, it will still send on commands but isn't recieveing the result, despite that definitely happening in the console:
18:20:02.251 MQT: stat/tvarea/RESULT = {"POWER1":"OFF"}
18:20:02.255 MQT: stat/tvarea/POWER1 = OFF

debug log showing sending
[2021-07-06 18:19:53,366] DEBUG: turning on tvarea relay 1

Any thoughts please?

Would it be a major pain to be able to set it to read json for the state
e.g. tele/tvarea/STATE

As then it would know what state it was in always and you can set that with teleperiod in tasmota to be more regular.

Not working - sending %fullTopic%/POWER with no arguments

I want to use OctoPrint-TasmotaMQTT to turn my printer on/off using a Shelley setup with MQTT. My MQTT sever is running and I see OctoPrint's messages (MQTT plugin installed). I started by installing OctoPrint-Tasmota and could not get it to work. It set up for MQTT. I then installed OctoPrint-TasmotaMQTT and managed to get it to work. So I uninstalled OctoPrint-Tasmota and then OctoPrint-TasmotaMQTT stopped working.

The icon-bolt stays orange, if I click it it starts spinning and never stops. I does send the correct topic "cmnd/mydevice/POWER" but with no "ON"/"OFF" arguments. So it almost works!

If I send POWER/ON command manually via MQTT.fx The bolt Icon changes colors and now my Shelly does not react (it works via the tasmota web page) I think the problem came about when I ran OctoPrint-Tasmota and it gave me an error saying the tasmota "setoptionxxx" need to be changed so I did. Don't remember witch option it was, maybe 109?

Anybody have the same issue?

Plugin does not check whether printer is currently printing when powering off after gcode delay

As per the title.

I have set my printer to turn off after a period of time after a print is complete so that the cool end fan keeps running until the hot end has cooled down a bit. The most recent version of the plugin has made this very easy.

Unfortunately, I forgot about this behaviour just now and launched right into a new print job as soon as one had completed. The plugin then dutifully turned off the printer after the configured delay, even though the printer was still printing.

I suggest that the plugin check whether the printer is currently printing before turning it off.

Turning on Relay(s) on file upload to OctoPrint server

Hey @jneilliii, great job on this plugin, it works great! I have a simple Tasmota WiFi plug that I'm using to control power to my printer. With this configuration, the printer's control board is not powered, and therefore can't run the "turn on relay" Gcode (as far as I understand). I wanted to create a more streamlined workflow, where I can achieve this:

  1. Upload a sliced file through Cura (via the OctoPrint plugin)
  2. The relay is switched to "on" when the file is received on the OctoPrint server
  3. OctoPrint waits according to the time set in TasmotaMQTT plugin, and then connects to the printer
  4. The print is started with the AutotartPrint plugin.

This way, I don't have to interact with the OctoPrint UI at all - I just send the file to the OctoPrint queue, and everything else happens automatically.

I modified your plugin to allow powering on specific relays on a file upload event, and it works great for me. If you'd like, I can submit a PR to add this feature to your plugin. Let me know if you'd be interested in doing that!

when no relay number is supplied, don't show |

A quick suggestion for the Tasmota-MQTT plugin - if the device doesn't need you to define a relay because it has only one, don't display the | character in the device name. So instead of the confirmation dialog saying tasmota_001| is currently ON. just display tasmota_001 is currently ON.. Same for the device name displayed when hovering over the icon.

Possible to use this in a different plugin?

Hi @jneilliii, thanks for the plugin, it helps a lot!

I started developing a touchscreen interface for Nextion displays, and I would like to add this plugin as a toggle button to my interface. (this is the part where I should mention that I have little programming experience, but I #tryhard) :D

How would it be possible to implement in python a toggle button of this plugin?
My example: I have a Tasmota device with MQTT set up. I can toggle the switch via GCode (M80...M81) but that requires the name of the device as well - and thus it cannot be 'universal'.

My current interface looks like this - the "Turn off Printer" button should toggle the PSU/Tasmota
image

Thanks 👍

update to 0.3.6 wiped configured units

Hi

Just updated to plugin version 0.3.6
I previously had 4 tasmota units configured - with various options enabled.
All 4 were gone/wiped when i updated !

If this was intentional is should probably be clearly warned before update of the plugin.

PS : the auto-off seems awesome - testing right now ;-)

Can't send M80 command while printer is disconnected

Hi jneilliii,
firstly, I absolutely love the plug in! Thank you very much for suppling it and looking after it :)
Now I am very new to Octoprint and am still navigating all the possibilities so I feel like an idiot for asking. How do I send the M80 IPAddress Command to Octoprint, when the Command line is disabled due to a disconnected printer? When I turn the printer off by clicking the lightning bolt or sending the M81 command, Octoprint changes the monitoring state from "Operational" to "Offline" and greys out the command line. I also cannot send commands in my OctoRemote App on my phone when the printer is disconnected. I'm sure this is a user error, but I'm afraid I have a really hard time getting to the bottom of this. Thank you very much for your help and keep up the great work :)

[FR] Ability to turn on printer without using GCode

My printer is connected to a Wifi plug that turn on and off the power. I've recently started using OctoDash and I'm trying to figure out a way to get OctoDash to turn on my printer automatically. Obviously Octoprint prevents you from sending gcode when the printer is off, even gcode that is intercepted by this plugin. Would it be possible to use a System Command or some other method besides gcode to get this plugin to turn the switch on and off?

OpenHab trigger the plugin?!

Hi,

so installed the plugin and it works great with my mqtt server (which is integrated in my OpenHab installation)

I can power on and off the printer via OpenHab App and or via the Octoprint gui.

But : If I power it on by OpenHab its just on and dont fire the commands to octoprint that i have configured in the Plugin.

If I power it on via the Octoprint Gui it works as expected.

The problem is i must connect first to octoprint gui and than klick on the on button - but what i want is just power it on via OpenHab App (with the Use of the configured commands like autoconnect and restart klipper and such things)

Is that possible in any way ?

PR?: Added support for onConnect / onDisconnect events + Some configurable UI changes

I've been using my own fork of the TasmotaMQTT plugin for a while now, but it might be worth making a PR for it.
The main thing that I wanted to have is less UI presence and have the plugin integrate more seamless with how I always used to use Octoprint. So i've added the option to turn the printer on / off when receiving 'CONNECTING' / 'DISCONNECTING' events, as well as options to hide the plugins presence in the sidebar / navigation bar.

(As I have it configured, one can automatically turn on the printer when clicking the 'connect' button in the connection sidebar pannel, and turn it off after a succesfull disconnect.)

https://github.com/RoboMagus/OctoPrint-TasmotaMQTT/

not sending MQTT requests for new devices

I'm trying to setup some new Tasmota plugs in Octoprint 1.9.3 with OctoPrint-TasmotaMQTT 0.3.9, existing devices are working fine, but when I add new devices while the logfile says that messages are being sent, I'm not seeing any MQTT messages, and I'm just getting a spinning icon (since the cmd/POWER command isn't actually getting published, and therefore not getting a response)

image

On another system I've subscribed to the topics tasmota/#, and just in case stat/#, tele/#, and cmnd/#

When I restart the octoprint server I see the following messages only:

tasmota/plg-ender3/cmnd/POWER (null)
tasmota/plg-ender3/stat/RESULT {"POWER":"OFF"}
tasmota/plg-ender3/stat/POWER OFF

Octoprint debug log shows

2024-04-12 22:56:13,160 - octoprint.plugins.mqtt - DEBUG - Sent message: tasmota/plg-ender3/cmnd/POWER - , retain=True
2024-04-12 22:56:13,163 - octoprint.plugins.mqtt - DEBUG - Sent message: tasmota/plg-prusaxl/cmnd/POWER - , retain=True

TasmotaMQTT log shows

[2024-04-12 22:55:48,696] DEBUG: tasmota/plg-ender3/stat/POWER
[2024-04-12 22:55:48,708] DEBUG: tasmota/plg-prusaxl/stat/POWER
[2024-04-12 22:55:48,742] DEBUG: abortTimeout: 30
[2024-04-12 22:55:48,743] DEBUG: powerOffWhenIdle: True
[2024-04-12 22:55:48,755] DEBUG: idleTimeout: 15
[2024-04-12 22:55:48,757] DEBUG: idleIgnoreCommands: M105
[2024-04-12 22:55:48,764] DEBUG: idleTimeoutWaitTemp: 50
[2024-04-12 22:55:48,775] DEBUG: Starting idle timer due to startup
[2024-04-12 22:56:13,157] DEBUG: checking status of plg-ender3 relay
[2024-04-12 22:56:13,160] DEBUG: checking status of plg-prusaxl relay
`[2024-04-12 22:56:13,258] DEBUG: Received message for tasmota/plg-ender3/stat/POWER: b'OFF'``

I've tried uninstalling and removing all data for the plugin, and reinstalling, and still I can only get the original device I set up over a year ago plg-ender3 to work, but not the new device plg-prusaxl. I can use mosquitto on the command line to publish 'tasmota/plg-prusaxl/cmnd/POWER (null)' and get the correct responses back,

Stat is not received for %topic%/%prefix%/

Hi,
I changed the topic to %topic%/%prefix%/ as this is the way I use it in all my set-ups.
The sonoff (in my case a sonoff POW) gets the "cmnd/Power ON" message. However, the symbol spins forever. As far as I can debug this, the plugin somehow misses the feedback from %topic%/stat/POWER. In the logfile I can see that frequently

"octoprint.plugins.tasmota_mqtt - INFO - checking status of 3D_printer relay" get logged. Looking up in the code I found
line 119 get called. As far as I understand, this should trigger the stat message. However, it seems it never gets the stat update and therefore spins forever

Plugin not working

Hi jneilliii,

I tried for a few hours to get your plugin to work but I am unable to do so.
I am using OctoPrint 1.3.10 running on OctoPi 0.16.0 with your plugin version 0.3.1 and MQTT Plugin 0.8.1 with a Sonoff POW with Tasmota 6.4.1.21.

The plugin is unable to show the status of the POW and/or change to on/off. Manual switching via mqtt is working.

Sonoff POW mqtt config:
Bildschirmfoto 2019-03-19 um 20 22 51

settings in your plugin:
Bildschirmfoto 2019-03-19 um 20 25 56

Mosquitto_sub output when I click the spinning lightning bolt icon
Bildschirmfoto 2019-03-19 um 20 28 56

it seems the command is successful but the icon on the web interface is still the spinning lightning bolt. Any idea what could be the cause?

debug log output from octprint

2019-03-19 20:28:07,827 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2019-03-19 20:28:08,851 - octoprint.plugins.tasmota_mqtt - INFO - Received message for tasmota/stat/prusa/POWER1: on
2019-03-19 20:28:08,854 - octoprint.plugins.tasmota_mqtt - INFO - Received message for tasmota/stat/prusa/POWER1: on
2019-03-19 20:28:43,002 - octoprint.plugins.tasmota_mqtt - INFO - subscribing to prusa relay 1
2019-03-19 20:28:43,008 - octoprint.plugins.tasmota_mqtt - INFO - checking prusa relay 1
2019-03-19 20:28:43,150 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:28:44,024 - octoprint.plugins.tasmota_mqtt - INFO - Received message for tasmota/stat/prusa/POWER1: on
2019-03-19 20:28:44,029 - octoprint.plugins.tasmota_mqtt - INFO - Received message for tasmota/stat/prusa/POWER1: on
2019-03-19 20:28:44,037 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:45,404 - octoprint.plugins.tasmota_mqtt - INFO - subscribing to prusa relay 1
2019-03-19 20:30:45,412 - octoprint.plugins.tasmota_mqtt - INFO - checking prusa relay 1
2019-03-19 20:30:45,519 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:45,524 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:46,425 - octoprint.plugins.tasmota_mqtt - INFO - Received message for tasmota/stat/prusa/POWER1: on
2019-03-19 20:30:46,429 - octoprint.plugins.tasmota_mqtt - INFO - Received message for tasmota/stat/prusa/POWER1: on
2019-03-19 20:30:46,438 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:46,443 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:49,233 - octoprint.plugins.tasmota_mqtt - INFO - subscribing to prusa relay 1
2019-03-19 20:30:49,239 - octoprint.plugins.tasmota_mqtt - INFO - checking prusa relay 1
2019-03-19 20:30:49,399 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:49,402 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:49,404 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:50,252 - octoprint.plugins.tasmota_mqtt - INFO - Received message for tasmota/stat/prusa/POWER1: on
2019-03-19 20:30:50,257 - octoprint.plugins.tasmota_mqtt - INFO - Received message for tasmota/stat/prusa/POWER1: on
2019-03-19 20:30:50,266 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:50,271 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on
2019-03-19 20:30:50,277 - octoprint.plugins.tasmota_mqtt - INFO - Received message for stat/prusa/POWER1: on

when I send the cmd/prusa/Power1 on command via mqtt the pow is switching.

Can't seem to get it to work right

Hi, I can't seem to get this to work

I have installed the Octoprint MQTT plugin and the TasmotaMQTT plugin.

I have configured the fulltopic and topic entries as per the instructions and i am using a single relay Tasmota device.

Fulltopic: ha/mod/%topic%/ (as in tasmota)
Topic: BB3CBE

2021-03-02_10h56_24
2021-03-02_10h56_43

When I click on the icon, it sends:
ha/mod/BB3CBE/POWER (as in, it does not send any data to the topic) it will do this regardless of the amount of times I click the icon.

Then if I manually turn on the device through the tasmota interface, the plugin then seems to recognize the state (icon goes green) but then clicking on it, it sends:
ha/mod/BB3CBE/POWER ON (or OFF)

not:
ha/mod/BB3BCE/cmnd/POWER ON (or OFF)

So it does not actually command the switch on.

If I change the Fulltopic to include cmnd then it works as expected but then after a reboot of the pi it does not.

What am I missing?

Power on and off not working

The GCODE power off and on function is not working. If I manually give the command

M81 $SONOFFIP 1

it doesn't do anything.

And I'm somewhat confused, you have this Octoprint-TasmotaMQTT plugin, but you also have Octoprint-Tasmota.

Can you elaborate on the differences or is one of these the successor of this add-on or something?

State topic changed

I believe in the last version of Tasmota the default state topic as changed.
Now I can still turn ON my Sonoff with OctoPrint-TasmotaMQTT, but the icon is spinning indefinitely waiting to get the state back.

I've updated from 6.5.0 to 8.1.0. My Full topic is %prefix%/%topic%/and this is exactly what I've put inside OctoPrint-TasmotaMQTT

Plugin can't be loaded / doesn't do anything / buttons don't work

Hey there, I have a problem with the plugin. It won't work at all with my installation.

In the frontend I get two different console errors:

Error calling onBeforeBinding on view model TasmotaMQTTViewModel : TasmotaMQTTViewModel/self.onBeforeBinding@https://bla.user.de/static/webassets/packed_plugins.js?f07a20fb:8127:12
callViewModelIf@https://bla.user.de/static/webassets/packed_core.js?3514a079:16543:34
callViewModel@https://bla.user.de/static/webassets/packed_core.js?3514a079:16497:20
bindViewModels/<@https://bla.user.de/static/webassets/packed_core.js?3514a079:17245:42
Pn@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11208:530
ur/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11229:66
bindViewModels@https://bla.user.de/static/webassets/packed_core.js?3514a079:17225:19
Error calling onDataUpdaterPluginMessage on view model TasmotaMQTTViewModel : TasmotaMQTTViewModel/self.onDataUpdaterPluginMessage@https://bla.user.de/static/webassets/packed_plugins.js?f07a20fb:8169:13
callViewModelIf@https://bla.user.de/static/webassets/packed_core.js?3514a079:16540:35
callViewModelsIf/<@https://bla.user.de/static/webassets/packed_core.js?3514a079:16489:28
Pn@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11208:530
ur/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11229:66
callViewModelsIf@https://bla.user.de/static/webassets/packed_core.js?3514a079:16487:7
callViewModels@https://bla.user.de/static/webassets/packed_core.js?3514a079:16481:21
DataUpdater/self._onPluginMessage/<@https://bla.user.de/static/webassets/packed_core.js?3514a079:15175:27
DataUpdater/self._ifInitialized@https://bla.user.de/static/webassets/packed_core.js?3514a079:15199:13
DataUpdater/self._onPluginMessage@https://bla.user.de/static/webassets/packed_core.js?3514a079:15174:14
OctoPrintSocketClient.prototype.propagateMessage/<@https://bla.user.de/static/webassets/packed_client.js?313d9a0c:421:24
Pn@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11208:530
ur/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11229:66
OctoPrintSocketClient.prototype.propagateMessage@https://bla.user.de/static/webassets/packed_client.js?313d9a0c:420:15
onMessage/<@https://bla.user.de/static/webassets/packed_client.js?313d9a0c:515:22
Zt/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11225:23
_t@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11213:392
Vt/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11224:369
ur/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:11229:73
onMessage@https://bla.user.de/static/webassets/packed_client.js?313d9a0c:514:15
[5]</EventTarget.prototype.dispatchEvent@https://bla.user.de/static/webassets/packed_libs.js?3339d949:22600:20
[14]</</SockJS.prototype._transportMessage/<@https://bla.user.de/static/webassets/packed_libs.js?3339d949:23313:16
[14]</</SockJS.prototype._transportMessage@https://bla.user.de/static/webassets/packed_libs.js?3339d949:23311:17
[3]</EventEmitter.prototype.emit@https://bla.user.de/static/webassets/packed_libs.js?3339d949:22516:18
WebSocketTransport/this.ws.onmessage@https://bla.user.de/static/webassets/packed_libs.js?3339d949:25387:10

The OctoPrint logfile looks like this:

2020-07-17 17:04:47,634 - octoprint.plugin - ERROR - Error while calling plugin tasmota_mqtt
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/__init__.py", line 224, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_tasmota_mqtt/__init__.py", line 186, in on_after_startup
    for relay in self._settings.get(["arrRelays"]):
TypeError: 'NoneType' object is not iterable
2020-07-17 17:04:48,171 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2020-07-17 17:04:48,312 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'query_string': 'l10n=de', 'path': '/', 'base_url': 'https://bla.user.de/'}
2020-07-17 17:04:54,027 - octoprint.server.util.sockjs - INFO - New connection from client: 91.64.147.20
2020-07-17 17:04:54,327 - octoprint.server.util.flask - INFO - Passively logging in user admin from 91.64.147.20
2020-07-17 17:04:54,356 - octoprint.access.users - INFO - Logged in user: admin
2020-07-17 17:04:54,483 - octoprint.server.util.sockjs - INFO - User admin logged in on the socket from client 91.64.147.20
2020-07-17 17:04:54,776 - octoprint.server.api.settings - ERROR - Could not load settings for plugin Tasmota-MQTT (0.3.6)
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/api/settings.py", line 288, in _get_plugin_settings
    result = plugin.on_settings_load()
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/types.py", line 1506, in on_settings_load
    if self.config_version_key in data:
TypeError: argument of type 'NoneType' is not iterable

Any ideas on how to fix this?

How to configure ? sending incorrect payload

I was creating something in node-red and stumbled upon this plugin, it looks to be very useful, thanks!

I am having some trouble configuring the topics.

Copying the "full topic" from my tasmota device doesn't work with the topic/prefix as my devices are organized per room, ie; devices/kleine_kamer/mpmd is my printer.

I configured it as:
Screenshot 2019-12-04 at 16 33 36

Looking in node-red, the plugin sends devices/kleine_kamer/mpmd/cmnd/POWER0 when I click the little power icon in the navbar:

Screenshot 2019-12-04 at 16 33 44

This should be devices/kleine_kamer/mpmd/cmnd/POWER 1 ?
(I assume that I can turn the printer on with the icon ?)

Also I was wondering how the control via g-code works - I cannot trigger a terminal command/print command as the printer is turned off; not connected.

Request: Labels for Relays

I'm using a 4 relay device that controls the power for lighting, venting and printer, and it really doesn't matter what I set the topic to, it says the same thing with just a number behind it.
Differing icons are OK, but it would be nice if the hints showed a proper name (ie: Lights instead of topic|2)
I was using your IP based plugin which did allow different Labels, however for various reasons we've split all IOT devices off to a separate network with the MQTT server being one of the few devices in both networks, so the IP based approach is no longer ideal.

Any chance of getting Labels added to the MQTT version?

No Ip On Setup Tab After Install

I installed the plugin after I did a complete net Octoprint setup but there is no Ip box (Where I can add the MQTT server / sonoff's ip adress) Is there something else I am missing? The previous time it all worked well.
2018-08-19_184223

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.