Comments (45)
Based on the reply I think you have one of two options. Enable SetOption26
or make the idx
field blank.
from octoprint-tasmota.
I've created the above separate issue for this.
from octoprint-tasmota.
The error being raised is unauthorized, which makes me believe it's trying to access a secure website, meaning tasmota has a password configured. What happens when you go the following address?
http://192.168.99.24/cm?user=admin&password=&cmnd=Power
from octoprint-tasmota.
- Tasmota version is V5.11.1a
- No PW configured on tasmota.
- ping from octopi to tasmota works fine.
When i test a litte python script from my mac (jupyter notebook) seems ok:
import socket
import json
import time
import logging
import os
import re
import urllib2
plugidx=""
webresponse = urllib2.urlopen("http://192.168.99.124/cm?user=admin&password=&cmnd=Power" + str(plugidx) + "%20on").read()
print(webresponse)
{"POWER":"ON"}
response = json.loads(webresponse)
print(response)
{u'POWER': u'ON'}
chk = response["POWER%s" % plugidx]
print(chk)
ON
I am a little confused ;-)
from octoprint-tasmota.
That is extremely odd and confuses me as well. Based on your test script my plugin should be working fine. What happens if you change your test script with the following line for assigning webresponse.
webresponse = urllib2.urlopen("http://192.168.99.124/cm?user=admin&password=&cmnd=Power" + str(plugidx)).read()
from octoprint-tasmota.
plugidx=""
webresponse = urllib2.urlopen("http://192.168.99.124/cm?user=admin&password=&cmnd=Power" + str(plugidx)).read()
print(webresponse)
{"POWER":"ON"}
Same result as before. I have also testet the script directly on the octopi-raspi in python console. Same result.
from octoprint-tasmota.
Then there is no reason why the plugin shouldn't be working. Can you upload your octoprint.log and latest plugin_tasmota_debug.log please?
from octoprint-tasmota.
Sure, hope its helpfully.
logs.zip
THX
from octoprint-tasmota.
What type of tasmota device do you have and how do you have it configured in the Configure Module section of the web interface? There isn't any reason this shouldn't be working for you. It is still returning an unauthenticated error, which still leads me to believe there is a password set, or something between the pi and tasmota device requesting authentication. The password I am referring to would be set at the link below, but still doesn't explain why it would work with your test script. I am completely stumped.
from octoprint-tasmota.
I have a Sonoff POW see pic.
There is definitely no password set. I tested the Python script again from the Raspi console to make sure the Raspi reaches Sonoff without authentication.
from octoprint-tasmota.
Hi, I have the same problem and maybe this can be a clue:
I started out with Tasmota FW 5.10.0 and plugin 0.2.0, this setup worked well.
After that I tried to update the plugin to 0.3.0, 0.5.0 both failed wit the error dialog in OctoPrint saying "Tasmota Error, Status unknown for 192.168.0.20. Double check IP Address\Hostname in Tasmota Settings".
If I went back to the version 0.2.0 it all worked again.
I saw somewhere that the FW has to be atleast 5.11 so I upgraded the FW to 5.11.1 in combination with plugin 0.5.0 but still the same error.
At this point I went back again to 0.2.0 but unfortunately this version do not work either anymore.
I have tried both with and without a Web Admin Password to access Tasmota.
I also tried: http://192.168.0.20/cm?user=admin&password=&cmnd=Power with a return of {"POWER":"OFF"}
from octoprint-tasmota.
Mysterious; -)
Maybe your MQTTT plugin would be more suitable for my project. Unfortunately, I cannot send individual MQTT messages.
My setup is the following:
Sonoff -> Octopi (Raspi)
After a printout, the following should happen:
Print_ready -> Raspi_shutdown_after_x_sec -> sonoff_off
This could be realized as follows:
- octoprint : print_ready
- MQTT send : sonoff3d/cmnd/backlog delay 9000; power1 0 <- power off after 15min
- MQTT plugin: system command before off: sudo shutdown -h +10 //shutdown after 10 min
But I should be able to send an individual MQTT command after the end of printing.
from octoprint-tasmota.
@mane-wt does your debug log look the same as @rewegit? Did you make the index blank?
from octoprint-tasmota.
Yes, the debug log looks similiar but the real problem was I had index set to 1 not blank.
Now it works for me, thanks!
from octoprint-tasmota.
Alright, looks like we're down to just @rewegit not being able to use the latest version for some unknown reason which has us both stumped. I guess the next step would be to try from scratch following these steps.
- uninstall the tasmota plugin.
- delete the tasmota section from the config.yaml file manually.
- restart octoprint.
- install tasmota plugin.
from octoprint-tasmota.
I think i am experiencing a similar issue. The plugin queries the status of the tasmota device correctly but after that in the log is said 'Invalid ip or unknown error connecting to 192.168.0.40'. According to the Sonoff's console the tasmota plugin gives the same command for the relay as its current state.
plugin_tasmota_debug.log
octoprint.log
from octoprint-tasmota.
Upgrade sonoff firmware to minimum 5.11.
from octoprint-tasmota.
I updated to 5.12c (current) but I still got an error message. I realized that the problem is with the 'plugidx'(i have a single relay switch). After modifying the init.py code it was finally fully functional. I edited plugidx = ' ' to plugidx = '1' at turn_on, turn_off and check_status. Now its working.
from octoprint-tasmota.
Sorry about that, looks like another settings I missed when translating over to the new settings interface. I forgot to put the index into the pop-up. Adding that now, expect a new version release shortly to address this issue.
from octoprint-tasmota.
Just released new version that shows that index option now. So make the index 1 and make sure that single relay device is checked in settings.
from octoprint-tasmota.
Thank you for your work!
from octoprint-tasmota.
Hello guys,
I am still getting this even with "Single relay device" enabled.
[2018-06-10 07:10:13,613] DEBUG: {u'username': u'admin', u'ip': u'192.168.60.171', u'password': u'mypass', u'command': u'checkStatus', u'idx': u'1'}
[2018-06-10 07:10:13,614] DEBUG: Using authentication for 192.168.60.171.
[2018-06-10 07:10:13,616] DEBUG: Checking status of 192.168.60.171 index .
[2018-06-10 07:10:13,705] DEBUG: 192.168.60.171 index response: {"POWER1":"ON"}
[2018-06-10 07:10:13,706] ERROR: Invalid ip or unknown error connecting to 192.168.60.171.
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint_tasmota/__init__.py", line 146, in check_status
chk = response["POWER%s" % plugidx]
KeyError: 'POWER'
[2018-06-10 07:10:13,708] DEBUG: 192.168.60.171 index is UNKNOWN
[2018-06-10 07:10:13,710] DEBUG: unknown error with 192.168.60.171.
I am using a POW 16A with 5.14.0 version of tasmota installed on it
Program Version 5.14.0
Build Date & Time 2018-05-15T15:29:54
Core/SDK Version 2_3_0/1.5.3(aec24ac9)
Uptime 0T11:54:54
Flash write Count 425 at F8000
Boot Count 107
Restart Reason Software/System restart
Friendly Name 1 portlight3
(removed)
MQTT Host 192.168.60.6
MQTT Port 1883
MQTT Client &
Fallback Topic DVES_F8978D
MQTT User
MQTT Topic portlight3
MQTT Group Topic sonoffs
MQTT Full Topic cmnd/portlight3/
Emulation None
mDNS Discovery Enabled
mDNS Advertise Web Server
ESP Chip Id 16291725
Flash Chip Id 1327328
Flash Size 1024kB
Program Flash Size 1024kB
Program Size 526kB
Free Program Space 476kB
Free Memory 19kB
Updated the issue with more precise information
from octoprint-tasmota.
It looks like from the error you have the wrong IP address in for the tasmota relay. Try 192.168.60.6 as it looks like that is being returned by the tasmota.
from octoprint-tasmota.
192.168.60.6 is my mqtt server. Is that actually used in the plugin ? Or is it an HTTP call made to the sonoff ?
Also are you sure that this is happening ? The debug log above clearly shows another ip address is being used. (Also I updated the description of the issue a few times)
from octoprint-tasmota.
This plugin utilizes web only, but if you have MQTT already up and running, you may want to consider my OctoPrint-MQTT plugin.
Either way, I Just remembered the new 5.14 version of tasmota implemented a change in how the device responds based on SetOption26. If you uncheck single relay and enter 1 for idx it should work.
from octoprint-tasmota.
If you mean Octopi-TasmotaMQTT, I never could get it work.
from octoprint-tasmota.
I think the Single relay device option should be per sonoff device and not as a global option. I have a POW and a Basic and the relay indexes are different in Tasmota.
from octoprint-tasmota.
I got this to work with leaving the index empty on my POW and the other one with index 1.
from octoprint-tasmota.
Yeah, OctoPrint-MQTT. What was the issue you ran into?
I would be interested in knowing on your POW vs the other one, is the other one also on 5.14? Do both have the SetOption26 on? If so you don't need the Single Relay option at all and the idx value of 1 should cover all cases.
from octoprint-tasmota.
I dont know about SetOption26. I ll look for it. Now everything is working fine.
I did not get a change to debug the TasmotaMQTT plugin. Not sure what was wrong with it.
from octoprint-tasmota.
Thanks. Looking at the info you posted above from your POW the most likely cause of grief was the FullTopic configuration. The latest version of my plugin allows for matching that so it's the same as what's configured on the Tasmota.
from octoprint-tasmota.
This issue has been automatically marked as stale because it has not had activity in 14 days. It will be closed if no further activity occurs in 7 days.
from octoprint-tasmota.
I'm sorry, but I have the same issue. I tried to reinstall the plugin, but still no joy. The funny thing is that it worked at first! Then after a few weeks, it worked only sometimes and now it is dead completely :( Any advice would be appreciated.
plugin_tasmota_debug.log
from octoprint-tasmota.
It looks like maybe either your ip address of the plug may have changed, or it's not on the network at all, or your pi doesn't have the ability to communicate with the device (not on same network or wifi restrictions where connected devices can't see other devices on the same wifi).
from octoprint-tasmota.
you are right! it seems to be a network issue. I can see the Sonoff device from my main computer just fine, but for some reason, raspberrypi does not. Thanks for giving me direction!
from octoprint-tasmota.
works perfectly! I had an extra USB wifi adapter and for reasons unknown, it did not work.
from octoprint-tasmota.
Something i found..
The Tasmota plugin, doesn't get the reply from tasmota switch:
like:
{"POWER":"OFF"}
{"POWER":"ON"}
I have turned off in all my tasmota Switches:
Web-Log Level
to level 0
So there's no reply for web...
Now i turned to Level 1 (INFO) all works fine..
;)
No Script error. Configuration Error at sonoff tasmota switch by User (me)
If Using Sonoff RF, check 1 Relay in plugin Config or leave Index empty.
I don't set 1 Relay, because using also sonoff 4chpro with index 1-4 at samt time.
Sorry.. for fast german englisch...
Tested sonoff rf & sonoff 4chpro
may be nice the Status of Switches may be polled some time,
if somone using parallel rf 433mhz remotes :-D
Was habe ich herausgefunden...
Das Tasmota plugin, bekommt nicht die erwartete Antwort vom Tasmota Schalter, wie z.B.:
{"POWER":"OFF"}
{"POWER":"ON"}
Ich habe aus gewohnheit, direkt immer überall auf den Tasmota Schaltern
das Logging fürs Web ausgechaltet...
Einstellungen->Logging konfigurieren->Web-Log Level
Level 0 = keine
Somit gibt es dann im Web auch keinerlei Rückmeldungen....
Nachdem ich dieses nun auf den Level 1 (INFO) umgestellt habe, funktioniert alles wie
erwartet.
Der Fehler lag nicht beim Script sondern beim User der das Einstellte (ich)... ;-D
Bei dem Sonoff RF, entweder den haken: 1 Relay in der Plugin Config setzen oder das Index Feld leer lassen.
Ich habe den haken bei 1 Relay weg gelassen, damit ich parallel ebenfalls einen SONOFF 4CH PRO steuern kann mit Index 1-4
Tested sonoff rf & sonoff 4chpro
Meine Sonoff Daten
Version:
Tasmota Version
6.6.0(release-sonoff)
Build-Datum & -Uhrzeit
2019.07.06 13:17:19
Core-/SDK-Version
2_3_0/1.5.3(aec24ac9)
Meine Plugin Daten
Tasmota (0.8.5)
Simple plugin to control sonoff devices that have been flashed with Tasmota.
from octoprint-tasmota.
Hello, I'm also facing similar issue with 'OpenBeken/Tasmota' - OpenBK723N device.
As per 'rewegit' comments, I was able to turn on/off device via Python script.
webresponse = urllib2.urlopen("http://192.168.0.133/cm?user=&password=&cmnd=Power" + str(plugidx) + "%20on").read()
print(webresponse)
{"POWER":"ON"}
webresponse = urllib2.urlopen("http://192.168.0.133/cm?user=&password=&cmnd=Power" + str(plugidx) + "%20off").read()
print(webresponse)
{"POWER":"OFF"}
The log has...
[2023-08-04 02:12:38,817] DEBUG: 192.168.0.133 index 1 is UNKNOWN
[2023-08-04 02:12:38,817] DEBUG: {'Status': {'Module': 0, 'DeviceName': 'obk1FF30CD8', 'FriendlyName': ['obk1FF30CD8_1'], 'Topic': 'obk1FF30CD8', 'ButtonTopic': '0', 'Power': 0, 'PowerOnState': 3, 'LedState': 1, 'LedMask': 'FFFF', 'SaveData': 1, 'SaveState': 1, 'SwitchTopic': '0', 'SwitchMode': [0, 0, 0, 0, 0, 0, 0, 0], 'ButtonRetain': 0, 'SwitchRetain': 0, 'SensorRetain': 0, 'PowerRetain': 0, 'InfoRetain': 0, 'StateRetain': 0}, 'StatusPRM': {'Baudrate': 115200, 'SerialConfig': '8N1', 'GroupTopic': 'MQTT', 'OtaUrl': 'https://github.com/openshwprojects/OpenBK7231T_App/releases/latest', 'RestartReason': 'HardwareWatchdog', 'Uptime': 5066, 'StartupUTC': '1969-12-31T22:35:34', 'Sleep': 50, 'CfgHolder': 4617, 'BootCount': 22, 'BCResetTime': '2022-01-27T16:10:56', 'SaveCount': 1235, 'SaveAddress': 'F9000'}, 'StatusFWR': {'Version': 'OpenBK7231N_1.17.205', 'BuildDateTime': 'Aug 2 2023 06:44:55', 'Boot': 7, 'Core': '0.0', 'SDK': 'obk', 'CpuFrequency': 80, 'Hardware': 'BK7231N', 'CR': '465/699'}, 'StatusLOG': {'SerialLog': 2, 'WebLog': 2, 'MqttLog': 0, 'SysLog': 0, 'LogHost': '', 'LogPort': 514, 'SSId1': 'TestWifi', 'SSId2': '', 'TelePeriod': 300, 'Resolution': '558180C0', 'SetOption': ['000A8009', '2805C80001000600003C5A0A000000000000', '00000280', '00006008', '00004000']}, 'StatusMEM': {'ProgramSize': 616, 'Free': 384, 'Heap': 25, 'ProgramFlashSize': 1024, 'FlashSize': 2048, 'FlashChipId': '1540A1', 'FlashFrequency': 40, 'FlashMode': 3, 'Features': ['00000809', '8FDAC787', '04368001', '000000CF', '010013C0', 'C000F981', '00004004', '00001000', '00000020'], 'Drivers': '1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45', 'Sensors': '1,2,3,4,5,6'}, 'StatusNET': {'Hostname': 'obk1FF30CD8', 'IPAddress': '192.168.0.133', 'Gateway': '192.168.0.1', 'Subnetmask': '255.255.255.0', 'DNSServer1': '192.168.0.1', 'DNSServer2': '0.0.0.0', 'Mac': 'fc:67:1f:f3:0c:d8', 'Webserver': 2, 'HTTP_API': 1, 'WifiConfig': 4, 'WifiPower': 17.0}, 'StatusMQT': {'MqttHost': '192.168.0.133', 'MqttPort': 1883, 'MqttClientMask': 'core', 'MqttClient': 'obk1FF30CD8', 'MqttUser': 'obk', 'MqttCount': 23, 'MAX_PACKET_SIZE': 1200, 'KEEPALIVE': 30, 'SOCKET_TIMEOUT': 4}, 'StatusTIM': {'UTC': '1970-01-01T00:00:00', 'Local': '1970-01-01T00:00:00', 'StartDST': '2022-03-27T02:00:00', 'EndDST': '2022-10-30T03:00:00', 'Timezone': '+01:00', 'Sunrise': '07:50', 'Sunset': '17:17'}, 'StatusSNS': {'Time': '1970-01-01T00:00:00', 'ENERGY': {'Power': 0.0, 'ApparentPower': 0.0, 'ReactivePower': 0.0, 'Factor': 1.0, 'Voltage': 239.717041, 'Current': 0.0, 'ConsumptionTotal': 0.0, 'ConsumptionLastHour': 0.0}}, 'StatusSTS': {'Time': '1970-01-01T00:00:00', 'Uptime': '0T01:24:26', 'UptimeSec': 5066, 'Heap': 25, 'SleepMode': 'Dynamic', 'Sleep': 10, 'LoadAvg': 99, 'MqttCount': 23, 'POWER': 'OFF', 'Wifi': {'AP': 1, 'SSId': 'TestWifi', 'BSSId': '30:B5:C2:5D:70:72', 'Channel': 11, 'Mode': '11n', 'RSSI': 58, 'Signal': -71, 'LinkCount': 21, 'Downtime': '0T06:13:34'}}}
[2023-08-04 02:12:43,420] DEBUG: {'command': 'checkStatus', 'ip': '192.168.0.133', 'idx': '1'}
[2023-08-04 02:12:43,420] DEBUG: Checking status of 192.168.0.133 index 1.
Can you please help if this device is supported by this plugin? or am I missing any settings?
Thanks.
from octoprint-tasmota.
From the Tasmota console what is the result of sending SetOption26
?
from octoprint-tasmota.
SetOption26 was not supported in OpenBeken, but setting idx field in the Tasmota plugin to blank worked! Thanks for the quick response.
By the way, the smart plug I use has a power monitoring chip 'BL0937', and I'm having trouble seeing the energy consumption data in the "Tasmota tab" - I tried inputting the date range and doesn't show anything. Also, sometimes hovering over and getting the stats sometimes works (voltage, energy consumed...) and sometimes doesn't. To make the stats appear while hovering over I need to refresh the Octoprint page. Is this something that can be fixed by tweaking the settings in the Octoprint plugin?
from octoprint-tasmota.
Sorry, I can't support every random fork of tasmota, but recommend you enable status polling and restart OctoPrint and see if that makes any difference.
from octoprint-tasmota.
After enabling the status polling, I was able to see the data when hovering over the power icon. But for some reason when I click the "Update" button after selecting the start and end date (as Today's), nothing happens. If I select a previous date range, then something displays as a graph with 'no plots' with the year starting randomly from '2001' or '2002'.
Also, I can see some db files are created that may be related to plotting the graph.
pi@octopi:~/.octoprint/data/tasmota $ ls -l
total 32
-rw-r--r-- 1 pi pi 24576 Aug 4 18:51 energy_data.db
-rw-r--r-- 1 pi pi 8192 Aug 4 13:17 sensor_data.db
I've seen an old post '#17' where I saw a similar issue, and it was fixed.
It may be not related to the fork of Tasmota since I was able to see the data (voltage, power, etc..), and also db is created, but seeing an issue when nothing happens when I click the 'Update' button to view the plot in a graph. I may be missing something, need help for the same. Thanks.
from octoprint-tasmota.
It's possible the time is off on the pi, causing the records in the db filter to be outside the range you are selecting in the UI.
from octoprint-tasmota.
I found out the problem!
I opened the energy_data.db using 'DB Browser for SQLite.exe' (https://sqlitebrowser.org/dl/) and noticed the value of 'idx' was empty in the entire column. Since 'idx' was left blank/empty to make the Tasmota switch to work.
'Index
Index of the relay, specifically used for multiple plug relay devices. Leave blank for single relay devices.'
So I manually edited the column for the field 'idx' to '1' in the db. Also, for some reason, the 'total' field was also blank so made it all to '0'. Then I pushed it back to the same location in the pi.
(~/.octoprint/data/tasmota/energy_data.db).
After a refresh, Voilà the graph worked!
I'm sure you can fix this issue! Please help with the same.
Thanks.
from octoprint-tasmota.
I found another related problem for the data getting stored to "energy_data.db".
In the Octoprint - using the Tasmota plugin, I can see all these values...
Just for the reference pasting the snap of smart plug page
But when I open the "energy_data.db" using SQL Lite, I see the "total" as "NULL". I don't why it is getting populating as 'NULL' if there is a valid Total Energy consumption value read by 'Tasmota Plugin'. Is it also related 'idx' value?
Thanks.
from octoprint-tasmota.
Related Issues (20)
- API support for status HOT 6
- Power off during printing HOT 4
- issue when upgrading to octoprint 1.8.1 HOT 5
- Theme Support
- switch via API call HOT 4
- Lots of connection errors HOT 2
- Sonoff POW not switching off... HOT 6
- power off on idle not working ? HOT 3
- Request: "Keepalive" Interval HOT 6
- icon picker doesn't seem to work HOT 9
- S31 Sonoff plug (Tasmota Error... status unknown for the IP) HOT 5
- READINGS DO NOT MATCH plug with athom energy meter HOT 6
- Plugin requires SetOption65 to be 0 to work, but my plug keeps resetting if I do that. HOT 3
- using GCODE for shutdown in .gcode files fails HOT 4
- 'Power off on idle' does not wait for bed to cool HOT 3
- No connection with new device HOT 9
- Issue With Power Monitoring With Blank IDX HOT 1
- Power off on idle not working on MK4 HOT 4
- Use separate scale/graph for power/cost HOT 7
- 'power off after print finishes' checkbox. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from octoprint-tasmota.