Samsung / SamsungAutomationStudio

Samsung Automation Studio is to provide development tools and execution environment that can easily configure application logic by connecting both Samsung service and 3rd party service. This project is to share the node for open source NodeRED developed by Samsung Automation Studio team to the community. If you are using nodered, you can easily install the node we provide. And you can use Samsung's IoT and AI-related services more easily, and you can have an extended experience in conjunction with your own services.
Apache License 2.0
56 stars 29 forks source link

The Status node fills the logs #4

Closed soosp closed 3 years ago

soosp commented 3 years ago

Happy New Year!

In my config the Status node checks the Washer device status regularly. This node puts a large amount of log messages into the system logs, and sends a message to the debug panel too at every status check. It is very annoying. Please make this behavior configurable from the Node-RED.

This is a sample debug panel entry:

      1. 1:18:29node: Washer
  1. msg : string[29] "[SmartThings] Status :Washer"

and here is a log entry: Jan 1 01:12:34 host Node-RED[15850]: body : {"components":{"main":{"custom.washerWaterTemperature":{"supportedWasherWaterTemperature":{"value":["none","cold","20","30","40","60","90"],"timestamp":"2020-11-15T08:49:32.133Z"},"washerWaterTemperature":{"value":"40","timestamp":"2020-12-27T14:14:07.240Z"}},"samsungce.autoDispenseSoftener":{"amount":{"value":null,"timestamp":"2020-12-31T23:46:22.478Z"},"supportedDensity":{"value":null,"timestamp":"2020-12-31T23:46:22.478Z"},"density":{"value":null,"timestamp":"2020-12-31T23:46:22.478Z"},"supportedAmount":{"value":null,"timestamp":"2020-12-31T23:46:22.478Z"}},"samsungce.autoDispenseDetergent":{"amount":{"value":null,"timestamp":"2020-12-31T23:46:17.668Z"},"supportedDensity":{"value":null,"timestamp":"2020-12-31T23:46:17.668Z"},"density":{"value":null,"timestamp":"2020-12-31T23:46:17.668Z"},"supportedAmount":{"value":null,"timestamp":"2020-12-31T23:46:17.668Z"}},"washerOperatingState":{"completionTime":{"value":"2020-12-29T13:29:14Z","timestamp":"2020-12-29T12:25:14.210Z"},"machineState":{"value":"stop","timestamp":"2020-12-29T12:25:14.005Z"},"washerJobState":{"value":"none","timestamp":"2020-12-29T12:25:14.200Z"},"supportedMachineStates":{"value":null,"timestamp":"2020-08-11T15:52:58.446Z"}},"switch":{"switch":{"value":"off","timestamp":"2020-12-29T12:25:14.071Z"}},"custom.washerAutoSoftener":{"washerAutoSoftener":{"value":null,"timestamp":"2020-08-11T16:29:26.508Z"}},"samsungce.washerCycle":{"washerCycle":{"value":"Table_00_Course_D0","timestamp":"2020-12-29T11:28:27.608Z"}},"ocf":{"st":{"value":null,"timestamp":"2020-08-22T10:05:02.375Z"},"mndt":{"value":null,"timestamp":"2020-08-22T10:08:50.290Z"},"mnfv":{"value":"DA_WM_A51_20_COMMON_30200918","timestamp":"2020-11-19T05:48:00.014Z"},"mnhw":{"value":"ARTIK051","timestamp":"2020-11-19T05:48:00.014Z"},"di":{"value":"5d44e82a-38ce-c943-6505-ccf8ec20d118","timestamp":"2020-08-02T10:39:08.244Z"},"mnsl":{"value":"http://www.samsung.com","timestamp":"2020-11-19T05:48:04.107Z"},"dmv":{"value":"res.1.1.0,sh.1.1.0","timestamp":"2020-11-19T05:48:04.477Z"},"n":{"value":"[washer] Samsung","timestamp":"2020-08-02T10:39:08.277Z"},"mnmo":{"value":"DA_WM_A51_20_COMMON|20213541|20010102001113430103000000000000","timestamp":"2020-11-19T05:48:04.288Z"},"vid":{"value":"DA-WM-WM-000001","timestamp":"2020-08-02T10:39:08.222Z"},"mnmn":{"value":"Samsung Electronics","timestamp":"2020-08-02T10:39:08.196Z"},"mnml":{"value":"http://www.samsung.com","timestamp":"2020-08-02T10:39:08.126Z"},"mnpv":{"value":"DAWIT 2.0","timestamp":"2020-11-19T05:48:00.014Z"},"mnos":{"value":"TizenRT 1.0 + IPv6","timestamp":"2020-11-19T05:48:00.014Z"},"pi":{"value":"12345678-1234-1234-1234-1234567890abc","timestamp":"2020-08-02T10:39:08.211Z"},"icv":{"value":"core.1.1.0","timestamp":"2020-08-02T10:39:08.267Z"}},"custom.disabledCapabilities":{"disabledCapabilities":{"value":["samsungce.autoDispenseDetergent","samsungce.autoDispenseSoftener","samsungce.softenerOrder","samsungce.softenerState"],"timestamp":"2020-11-22T07:38:23.123Z"}},"custom.washerRinseCycles":{"supportedWasherRinseCycles":{"value":["0","1","2","3","4","5"],"timestamp":"2020-11-22T07:38:23.123Z"},"washerRinseCycles":{"value":"2","timestamp":"2020-11-07T10:06:04.981Z"}},"samsungce.driverVersion":{"versionNumber":{"value":20092501,"timestamp":"2020-11-22T07:38:23.123Z"}},"samsungce.kidsLock":{"lockState":{"value":"unlocked","timestamp":"2020-11-22T07:38:23.123Z"}},"samsungce.detergentOrder":{"alarmEnabled":{"value":false,"timestamp":"2020-11-22T07:38:23.123Z"},"orderThreshold":{"value":0,"unit":"cc","timestamp":"2020-11-22T07:38:23.123Z"}},"powerConsumptionReport":{"powerConsumption":{"value":{"energy":53600,"deltaEnergy":0,"power":0,"powerEnergy":0,"persistedEnergy":0,"energySaved":0,"start":"2020-12-29T12:13:28Z","end":"2020-12-29T12:24:46Z"},"timestamp":"2020-12-29T12:24:46.300Z"}},"samsungce.softenerOrder":{"alarmEnabled":{"value":null,"timestamp":"2020-12-31T23:46:27.921Z"},"orderThreshold":{"value":null,"unit":"cc","timestamp":"2020-12-31T23:46:27.921Z"}},"custom.washerSoilLevel":{"supportedWasherSoilLevel":{"value":null,"timestamp":"2020-08-11T16:31:24.029Z"},"washerSoilLevel":{"value":null,"timestamp":"2020-08-11T16:31:24.029Z"}},"samsungce.detergentState":{"remainingAmount":{"value":0,"unit":"cc","timestamp":"2020-11-22T07:38:23.123Z"},"dosage":{"value":0,"unit":"cc","timestamp":"2020-11-22T07:38:23.123Z"},"initialAmount":{"value":0,"unit":"cc","timestamp":"2020-11-22T07:38:23.123Z"},"detergentType":{"value":null,"timestamp":"2020-11-22T09:14:07.554Z"}},"refresh":{},"custom.jobBeginningStatus":{"jobBeginningStatus":{"value":null,"timestamp":"2020-08-11T19:22:52.541Z"}},"execute":{"data":{"value":{"payload":{"rt":["x.com.samsung.da.mode"],"if":["oic.if.baseline","oic.if.a"],"x.com.samsung.da.options":["AvailableDelayTime_64"]}},"data":{"href":"/course/vs/0"},"timestamp":"2020-12-29T12:25:14.845Z"}},"samsungce.softenerState":{"remainingAmount":{"value":null,"unit":"cc","timestamp":"2020-12-31T23:46:12.433Z"},"dosage":{"value":null,"unit":"cc","timestamp":"2020-12-31T23:46:08.127Z"},"softenerType":{"value":null,"timestamp":"2020-11-22T07:38:24.187Z"},"initialAmount":{"value":null,"unit":"cc","timestamp":"2020-11-26T04:07:34.642Z"}},"remoteControlStatus":{"remoteControlEnabled":{"value":"false","timestamp":"2020-08-11T17:24:04.555Z"}},"custom.supportedOptions":{"supportedCourses":{"value":["D0","DC","DB","DA","D9","D8","D7","D6","D5","BA","D4","D3","D2","D1"],"timestamp":"2020-08-02T10:39:08.537Z"}},"custom.washerAutoDetergent":{"washerAutoDetergent":{"value":null,"timestamp":"2020-08-22T09:29:10.906Z"}},"custom.washerSpinLevel":{"washerSpinLevel":{"value":"1400","timestamp":"2020-12-27T08:05:30.311Z"},"supportedWasherSpinLevel":{"value":["rinseHold","noSpin","400","800","1000","1200","1400"],"timestamp":"2020-11-15T08:49:32.094Z"}}}}} Jan 1 01:12:34 host Node-RED[15850]: 1 Jan 01:12:34 - [warn] [status-device:Washer] [SmartThings] Status :Washer Jan 1 01:12:39 host Node-RED[15850]: ------------------------------------------------------ Jan 1 01:12:39 host Node-RED[15850]: method : GET Jan 1 01:12:39 host Node-RED[15850]: url : https://api.smartthings.com/v1/devices/12345678-1234-1234-1234-1234567890abc/status Jan 1 01:12:39 host Node-RED[15850]: query : {"deviceId":"12345678-1234-1234-1234-1234567890abc"} Jan 1 01:12:39 host Node-RED[15850]: ------------------------------------------------------ Jan 1 01:12:39 host Node-RED[15850]: statusCode : 200

lslomczynski commented 3 years ago

Hello, I've noticed the same a while ago - my logs were growing very fast with tons of SD Card writes which, what we all know, is not good for them :-)

I planned to raise this issue but then I made a "temporary" walkaround by setting up rsyslog rules that filter out Node-RED related logs that match several SmartThings related patterns.

As usual - a temporary fix became pernament but it would be really great to add log level pick options to the SmartThings sonfiguration node. Maby something similar to Zigbee2mqtt node? Screen shot below :-)

4573B09D-9F6E-4E44-BEBC-4463743C5EF5

shgood commented 3 years ago

Hi, guys. Thank you for sharing the issue.

we added the logging option checkbox to 'status-device', 'command-device' nodes. Setting this option 'un-checked', doesn't print device response logs.

image

Thank you.

soosp commented 3 years ago

Hi, Thank you for this improvment. What do you think is this possible to do same thing with debug panel messages like this one below?

      1. 22:15:43node: Washer msg : string[28] "[SmartThings] Status :Washer"
shgood commented 3 years ago

@soosp

We will add additional logging option to the next version so that the options can be applied to the debug panel as well.

Thank you.